Changes between Version 57 and Version 58 of S3/S3AAA/OrgAuth
- Timestamp:
- 06/13/14 12:02:33 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3AAA/OrgAuth
v57 v58 11 11 Person entity types implement the pr_pentity super-entity: 12 12 13 {{{ 13 {{{#!python 14 14 table = define_table(tablename, 15 15 super_link("pe_id", "pr_pentity"), … … 23 23 To retrieve the person entity ID (pe_id) of any instance record, you can use: 24 24 25 {{{ 25 {{{#!python 26 26 pe_id = s3db.pr_get_pe_id(tablename, record_id) 27 27 }}} … … 47 47 Where 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}}}: 48 48 49 {{{ 49 {{{#!python 50 50 s3db.configure(tablename, 51 51 update_realm=True) … … 54 54 Realm entity updates will propagate to all components listed under the '''realm_components''' setting: 55 55 56 {{{ 56 {{{#!python 57 57 s3db.configure(tablename, 58 58 update_realm=True, … … 64 64 ==== 1. 'Global 'auth.realm_entity''' function: ==== 65 65 It is possible to set a global method for the realm_entity hook in the config.py of the respective template: 66 {{{ 66 {{{#!python 67 67 settings.auth.realm_entity = function 68 68 }}} … … 71 71 If the function returns {{{0}}}, then set_record_owner will fall back to the table-specific realm_entity setting. 72 72 ==== 2. Table '''realm_entity''' function: ==== 73 {{{ 73 {{{#!python 74 74 s3db.configure(tablename, 75 75 realm_entity = function_or_lambda) … … 113 113 To check which realms a role of the current user applies for, you can access: 114 114 115 {{{ 115 {{{#!python 116 116 realms = current.auth.user.realms[role] 117 117 }}}