Changes between Version 20 and Version 21 of S3/S3AAA
- Timestamp:
- 01/17/11 11:17:46 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3AAA
v20 v21 65 65 ACLs are stored per role and request destination in the {{{s3_permission}}} table, which is defined by the {{{S3Permission}}} class (in {{{modules/s3/s3aaa.py}}}). 66 66 67 For every destination (controller/function/table) two ACLs can be defined to be applied depending on whether a user ownes the record or not: 68 69 - one ACL for users owning a record (Owner ACL = {{{oacl}}}) 70 - one ACL for any other user not owning the record (User ACL = {{{uacl}}}). 71 72 If a user ownes a record, then the most permissive of the User ACL and the Owner ACL gets applied, otherwise only the User ACL gets applied. 73 67 74 === Record Ownership === 68 75 … … 77 84 A user is considered ''owner'' of a record if he has either created the record (user ID == {{{created_by}}}), or he is a member of the owner group ({{{owned_by}}} in user roles). 78 85 79 In tables which do not define either of these meta-fields, ownership rules are not applied .86 In tables which do not define either of these meta-fields, ownership rules are not applied ({{{uacl}}} only). 80 87 81 Record ownership allows to set different permissions depending on whether a user ownes a record or not: 88 === Controller/Table Restriction === 82 89 83 - one ACL for users owning a record (Owner ACL = {{{oacl}}}) 84 - one ACL for any other user not owning the record (User ACL = {{{uacl}}}).90 ACLs can be defined for controllers, or for particular functions inside controllers.[[BR]] 91 ACLs can additionally be defined for database tables. 85 92 86 If a user ownes a record, then the most permissive of the User ACL and the Owner ACL gets applied, otherwise only the User ACL gets applied. 87 === Controller Restriction === 93 The controller ACLs are applied when the respective controller is set to {{{restricted=True}}} in {{{deployment_settings.modules}}} ({{{000_config.py}}}): 88 94 89 === Resource Restriction === 95 {{{ 96 dvi = Storage( 97 name_nice = T("Disaster Victim Identification"), 98 description = T("Disaster Victim Identification"), 99 100 restricted = True, # Apply controller ACLs 101 102 module_type = 10, 103 resources = Storage( 104 dvi_recreq = {"importer" : True}, 105 ) 106 ), 107 }}} 108 109 The Controller ACL can be defined for all functions in a controller, or a particular function inside a controller, where the function-specific ACL overrides the general controller ACL. That means, you can define a general ACL for the {{{pr}}} controller, and a different one for the {{{pr/person}}} function. 110 111 The Controller ACLs are applied to ''all'' resources when accessed through this controller/function. If the Controller ACL does not specify any permission, the request is rejected as "Unauthorized". 112 113 Once the user has passed that controller permission check, and requests access to a particular table, the controller checks for table-specific ACLs. If there are specific ACLs for this table, then the most ''restrictive'' of controller and cable ACLs apply (i.e. you cannot allow on the table level what you forbid at the controller level, and vice versa). If there are no specific ACLs defined for this table, then the controller ACLs apply. 90 114 91 115 == Implementation of Access Control ==