Changes between Version 57 and Version 58 of S3/S3AAA/OrgAuth


Ignore:
Timestamp:
06/13/14 12:02:33 (11 years ago)
Author:
MattS
Comment:

syntax highlighting

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3AAA/OrgAuth

    v57 v58  
    1111Person entity types implement the pr_pentity super-entity:
    1212
    13 {{{
     13{{{#!python
    1414        table = define_table(tablename,
    1515                             super_link("pe_id", "pr_pentity"),
     
    2323To retrieve the person entity ID (pe_id) of any instance record, you can use:
    2424
    25 {{{
     25{{{#!python
    2626    pe_id = s3db.pr_get_pe_id(tablename, record_id)
    2727}}}
     
    4747Where the realm entity can be determined from the record itself, you may wish it to be updated along with changes in the record. In this case, you can set the '''update_realm''' setting for the table to {{{True}}}:
    4848
    49 {{{
     49{{{#!python
    5050    s3db.configure(tablename,
    5151                   update_realm=True)
     
    5454Realm entity updates will propagate to all components listed under the '''realm_components''' setting:
    5555
    56 {{{
     56{{{#!python
    5757    s3db.configure(tablename,
    5858                   update_realm=True,
     
    6464==== 1. 'Global 'auth.realm_entity''' function: ====
    6565It is possible to set a global method for the realm_entity hook in the config.py of the respective template:
    66 {{{
     66{{{#!python
    6767settings.auth.realm_entity = function
    6868}}}
     
    7171If the function returns {{{0}}}, then set_record_owner will fall back to the table-specific realm_entity setting.
    7272==== 2. Table '''realm_entity''' function: ====
    73 {{{
     73{{{#!python
    7474s3db.configure(tablename,
    7575               realm_entity = function_or_lambda)
     
    113113To check which realms a role of the current user applies for, you can access:
    114114
    115 {{{
     115{{{#!python
    116116    realms = current.auth.user.realms[role]
    117117}}}