- Timestamp:
- 8 Oct 2012, 09:16:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
r9312 r9313 307 307 @grok.subscribe(IUserAccount, grok.IObjectRemovedEvent) 308 308 def handle_account_removed(account, event): 309 """When an account is removed, local roles might have to be deleted. 309 """When an account is removed, local and global roles might 310 have to be deleted. 310 311 """ 311 312 local_roles = account.getLocalRoles() 312 313 principal = account.name 314 313 315 for role_id, object_list in local_roles.items(): 314 316 for object in object_list: … … 316 318 role_manager = IPrincipalRoleManager(object) 317 319 except TypeError: 318 # No role manager, noroles to remove320 # No Account object, no role manager, no local roles to remove 319 321 continue 320 322 role_manager.unsetRoleForPrincipal(role_id, principal) 323 role_manager = IPrincipalRoleManager(grok.getSite()) 324 roles = account.getSiteRolesForPrincipal() 325 for role_id in roles: 326 role_manager.unsetRoleForPrincipal(role_id, principal) 321 327 return 322 328 … … 445 451 # Log actions... 446 452 items_changed = ', '.join(changed) 447 grok.getSite().logger.info('%s - %s - Userupdated: %s'453 grok.getSite().logger.info('%s - %s - updated: %s' 448 454 % (self.name, row['name'], items_changed)) 449 455 return
Note: See TracChangeset for help on using the changeset viewer.