Changes between Version 33 and Version 34 of S3/S3AAA/OrgAuth


Ignore:
Timestamp:
09/04/12 10:48:02 (9 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3AAA/OrgAuth

    v33 v34  
    1717The '''realm''' of a person entity is the set of all records controlled ("owned") by this entity (="their data"). Which entity gains control over a record can be defined per record type, and even as deployment options. The realm which a particular record belongs to is encoded as person entity ID (pe_id) in the owned_by_entity field in this record.
    1818
     19The "owned_by_entity" field - if present in the table - gets automatically populated in CRUD and Imports (during create), using the auth.set_record_owner method. This method can be influenced by the '''owner_entity''' table hook:
     20
     21{{{
     22s3db.configure(tablename,
     23               owner_entity = function_or_lambda)
     24}}}
     25
     26The hook function must accept {{{(table, row)}}} as parameters, and return the pe_id (Person Entity ID) of the owner entity.
     27
     28It is possible to set a global default for the owner_entity hook in the config.py of the respective template:
     29{{{
     30settings.auth.owner_entity = function
     31}}}
     32
     33'''NOTE:''' the global owner_entity setting overrides any table-specific setting (this is deliberate), i.e. to retain a table specific setting, you must repeat it in the global hook function.
    1934=== Role Restrictions ===
    2035