Changes between Version 1 and Version 2 of DeveloperGuidelines/Organisations
- Timestamp:
- 03/21/11 07:17:57 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/Organisations
v1 v2 27 27 28 28 The roles are created by the {{{shn_create_record_roles}}} function in {{{models/05_org.py}}}, which can be called from an org or site create_onaccept by configuring the model as following: 29 {{{ 29 {{{ 30 30 # Create roles for each organisation / site instance 31 31 s3xrc.model.configure(table, 32 32 create_onaccept = shn_staff_join_onaccept_func(tablename)) 33 }}} 33 }}} 34 34 (This code should be called after the resource table is defined in the model) 35 35 36 36 === Enabling Staff Permissions === 37 37 1. Set: 38 {{{ 38 {{{ 39 39 deployment_settings.security.policy = 3 # Controller-ACLs. 4 & 5 will also work 40 40 deployment_settings.aaa.has_staff_permissions = True … … 44 44 .... 45 45 restricted = True, 46 }}} 46 }}} 47 47 2. When a new organisation or site instance is created: 48 48 i. New roles (staff & supervisor) are automatically created for that record (tablename_recordid Staff of recordname & tablename_recordid Supervisors of recordname). … … 53 53 === Inheriting Permissions === 54 54 To allow other components inherit the same permissions as the primary resource, the following function can be called, to add a onaccept function which will copy the "owned_by_role" from the primary resource. This onaccept should be added to the onaccept for the component resource. 55 {{{ 55 {{{ 56 56 # Update owned_by_role to the site's owned_by_role 57 57 s3xrc.model.configure( … … 62 62 pk = "site_id") 63 63 ) 64 }}} 64 }}} 65 65 66 66 The staff component resource itself currently inherit permissions from sites not organisations, because this is LESS permissive. This may need to become a deployment setting. … … 69 69 Inventories can be added to any site instance, by adding {{{shn_show_inv_tabs(r)}}} to the rheader tabs for that site instance. 70 70 71 ---- 72 BluePrintOrganisationRegistry 73 74 DeveloperGuidelines