Code

Changes between Version 18 and Version 19 of RowLevelPermissions


Ignore:
Timestamp:
08/06/06 12:54:50 (8 years ago)
Author:
clong
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RowLevelPermissions

    v18 v19  
    9090}}} 
    9191 
    92 To return the instance of a row level permission use the attribte "type". For example: 
     92To return the instance of a row level permission use the attribte "model". For example: 
    9393{{{ 
    9494#!python 
    9595... 
    96 object = row_level_permission.type 
     96object = row_level_permission.model 
    9797... 
    9898}}} 
    99 ''Developer's note: This will most likely change as I'm not too sure "type" accurately describes what it represents. I will update this page when I make the change.'' 
     99''Developer's note: This will most likely change as I'm not too sure "model" accurately describes what it represents. I will update this page when I make the change.'' 
    100100 
    101101=== Creating a Row Level Permission === 
     
    128128=== Checking Permissions === 
    129129 
    130 This will be integrated into the GenericAuthorization SoC project. More info to come. 
     130In the next week, GenericAuthorization and row level permissions will be merged. Therefore, I have shown two different methods of checking for permissions, one using the generic authorization and the currently implemented technique. 
     131 
     132The current method uses the has_perm method in the User model. Note: The object parameter is optional, this is to allow backwards compatibility. 
     133 
     134Example: 
     135{{{ 
     136#!python 
     137... 
     138user.has_perm("can_mine", object=mineral) 
     139... 
     140}}} 
     141 
     142This will return either True or False depending on if the user has the correct permission. It will return false if the user has a negative row level permission on the object.  
     143 
     144This will also check group row level permissions. If the user is in two groups, the first having a positive row level permission and the second having a negative row level permission, it will take the positive row level permission over the negative. 
     145 
     146'''Second method using GenericAuthorization will be written after the merger''' 
     147 
    131148 
    132149== Implementation Notes ==