45 | | The '''realm''' of a person entity is the set of all records controlled ("owned") by this entity (="their data"). The realm which a particular record belongs to is encoded as person entity ID (pe_id) in the {{{realm_entity}}} field in this record. The "realm_entity" field - if present in the table - gets automatically populated in CRUD and Imports (during create), using the auth.s3_set_record_owner method. |
| 45 | The '''realm''' of a person entity is the set of all records controlled ("owned") by this entity (="their data"). The realm which a particular record belongs to is encoded as person entity ID (pe_id) in the {{{realm_entity}}} field in this record. The "realm_entity" field - if present in the table - gets automatically populated in CRUD and Imports (during create), using the auth.s3_set_record_owner method. |
| 46 | |
| 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 | |
| 49 | {{{ |
| 50 | s3db.configure(tablename, |
| 51 | update_realm=True) |
| 52 | }}} |
| 53 | |
| 54 | Realm entity updates will propagate to all components listed under the '''realm_components''' setting: |
| 55 | |
| 56 | {{{ |
| 57 | s3db.configure(tablename, |
| 58 | update_realm=True, |
| 59 | realm_components=["abc", "xyz"]) |
| 60 | }}} |