Changes between Version 7 and Version 8 of CookBook/PermissionPolicies
- Timestamp:
- Mar 19, 2017, 12:31:43 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook/PermissionPolicies
v7 v8 43 43 44 44 def check_permission(self, action, username, resource, perm): 45 if action == 'TICKET_CHANGE_STATE' \46 and resource is not None\47 and resource.realm == 'ticket'\48 andresource.id is not None:45 if action == 'TICKET_CHANGE_STATE' and \ 46 resource is not None and \ 47 resource.realm == 'ticket' and \ 48 resource.id is not None: 49 49 ticket = Ticket(self.env, resource.id) 50 50 return ticket['owner'] == username … … 102 102 103 103 def check_permission(self, action, username, resource, perm): 104 if action in self.allowed_actions \105 and resource is not None\106 and resource.realm == 'ticket'\107 andresource.id is not None:104 if action in self.allowed_actions and \ 105 resource is not None and \ 106 resource.realm == 'ticket' and \ 107 resource.id is not None: 108 108 ticket = Ticket(self.env, resource.id) 109 109 if ticket['owner'] == username: