Code

Changes between Version 24 and Version 25 of RowLevelPermissions


Ignore:
Timestamp:
08/19/06 11:00:21 (8 years ago)
Author:
clong
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RowLevelPermissions

    v24 v25  
    129129'''Second method using GenericAuthorization will be written after the merge. It will follow the documentation written on GenericAuthorization''' 
    130130 
     131=== Checking Permissions in a Template === 
     132 
     133In a template, you can use the tag if_has_perm to check for permissions. The tag has the following syntax:  
     134{% load auth %} 
     135{% if_has_perm [not] (permission codename) [object] %} 
     136... 
     137{% else %} 
     138... 
     139{% end_if_has_perm %} 
     140The parameters in square brackets are optional and the normal brackets are required. The else statement is optional. The permission codename should be in the format: app_label.codename. 
     141 
     142=== Administration === 
     143 
     144You can set up row level permissions to be created automatically by the admin interface when a user creates an object by using the options: grant_change_row_level_perm and grant_delete_row_level_perm. By default these are turned off. An example: 
     145{{{ 
     146#!python 
     147... 
     148class Mineral(models.Model): 
     149...     
     150    class Admin: 
     151        grant_change_row_level_perm=True 
     152        grant_delete_row_level_perm=True 
     153     
     154    class Meta: 
     155        row_level_permissions = True 
     156... 
     157}}} 
    131158 
    132159== Implementation Notes ==