Changes between Version 30 and Version 31 of RowLevelPermissions


Ignore:
Timestamp:
08/20/06 15:58:49 (9 years ago)
Author:
clong
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RowLevelPermissions

    v30 v31  
    8383#!python
    8484...
    85 user.has_perm("can_mine", object=mineral)
     85user.has_perm("mine.can_mine", object=mineral)
    8686...
    8787}}}
     
    9292
    9393'''Second method using GenericAuthorization will be written after the merge. It will follow the documentation written on GenericAuthorization'''
     94
     95==== Has Row Level Permission ====
     96
     97The method contains_permission checks if the user has the given permission on a model (not an instance of a model but the model). This checks if there is exists the given row level permission on any of the instances of the model. It is used in the admin interface to determine if the change list should be shown to the user.
     98
     99E.g. If user A has change permission on article 234, and you did:
     100{{{
     101#!python
     102...
     103userA.contains_permission("mine.change_mineral", Mineral)
     104...
     105}}}
     106It will return True.
     107
     108''I am not a fan of contains_permission name, but for now it does work. If you have any ideas on how to change it, please let me know.''
    94109
    95110=== Checking Permissions in a Template ===
Back to Top