Changes between Version 4 and Version 5 of RowLevelPermissionsDeveloper


Ignore:
Timestamp:
Nov 23, 2006, 10:10:37 PM (18 years ago)
Author:
Adrian Holovaty
Comment:

Made some edits

Legend:

Unmodified
Added
Removed
Modified
  • RowLevelPermissionsDeveloper

    v4 v5  
    1 [[TOC(inline)]]
     1== Row-level permissions model ==
    22
    3 == Row Level Permissions Model ==
    4 
    5 Row Level Permissions uses generic relations to decrease the number of tables to only one. The generic relations allow us to create row level permissions with any instance of any model and connect it to an "owner" object. To allow more freedom, the owner object is also a generic relation. This means that you can use your own models as an owner of a row level permission. The actual model code is below:
     3The row-level permissions system uses generic relations to decrease the number of tables to only one. The generic relations allow us to create row-level permissions with any instance of any model and connect it to an "owner" object. To allow more freedom, the owner object is also a generic relation. This means that you can use your own models as an owner of a row-level permission. The actual model code is below:
    64
    75{{{
     
    2624}}}
    2725
    28 This does not modify the current permissions table at all, and can be layered ontop of it if the developer wishes to but it can be ignored easily.
     26This does not modify the current permissions table at all, and can be layered on top of it if the developer wishes to but it can be ignored easily.
    2927
    30 == How Row Permissions Are Enabled ==
     28== How row permissions are enabled ==
    3129
    32 Row permissions are enabled using the meta class, please see RowLevelPermissions for more information on how to enable them. How this is done is in django.db.models.base.ModelBase under __new__ is the following snippet:
     30Row permissions are enabled using the meta class, please see RowLevelPermissions for more information on how to enable them. How this is done is in django.db.models.base.ModelBase under {{{__new__}}} is the following snippet:
    3331
    3432{{{
     
    4038}}}
    4139
    42 In django.db.models.options.Options it has been modified to set row_level_permissions as disabled by default.
     40{{{django.db.models.options.Options}}} has been modified to set {{{row_level_permissions}}} as disabled by default.
    4341
    44 == Owner Objects ==
     42== Owner objects ==
    4543
    46 At this current point of time, you can set up an owner by including the following relation:
     44Currently, you can set up an owner by including the following relation:
     45
    4746{{{
    4847#!python
    49 ...
    5048row_level_permissions_owned = models.GenericRelation(RowLevelPermission, object_id_field="owner_id", content_model_field="owner_ct", related_name="owner")
    51 ...
    5249}}}
    5350
    54 I might be changing this around in the near future, but I only expect it to be used a few times I don't see a large need to make this a similiar process to the enabling of row level permissions on objects. Please give feedback if you think otherwise.
     51I might be changing this around in the near future, but I only expect it to be used a few times, and I don't see a large need to make this a similiar process to the enabling of row-level permissions on objects. Please give feedback if you think otherwise.
    5552
    56 == Checking of Row Level Permissions ==
     53== Checking of row-level permissions ==
    5754
    5855Checking of RLP are done in the following order: User RLP->Group RLP->User Model Level->Group Model Level. Stopping at the first positive or negative.
    5956
    60 The has_perm method has been modified to now check for row level permissions and has an optional parameter for a model instance, which is required to check row level permissions.
     57The {{{has_perm()}}} method has been modified to now check for row-level permissions and has an optional parameter for a model instance, which is required to check row-level permissions.
    6158
    6259{{{
     
    8986}}}
    9087
    91 == Integration into Administration Application ==
     88== Integration into administration application ==
    9289
    9390Being worked on. Will post when it is complete or near enough to have a better idea.
    9491
    95 == Test Cases of Row Level Permissions ==
     92== Test cases of row-level permissions ==
    9693
    9794=== API ===
Back to Top