Changeset 7185 for main/waeup.sirp/trunk
- Timestamp:
- 24 Nov 2011, 09:51:22 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
r7177 r7185 214 214 def handle_account_added(account, event): 215 215 """When an account is added, the local owner role and the global 216 PortalUser role must be set.216 AcademicsOfficer role must be set. 217 217 """ 218 218 # We set the local Owner role … … 220 220 role_manager_account.assignRoleToPrincipal( 221 221 'waeup.local.Owner', account.name) 222 # We set the global PortalUser role222 # We set the global AcademicsOfficer role 223 223 site = grok.getSite() 224 224 role_manager_site = IPrincipalRoleManager(site) 225 225 role_manager_site.assignRoleToPrincipal( 226 'waeup. PortalUser', account.name)226 'waeup.AcademicsOfficer', account.name) 227 227 # Finally we have to notify the user account that the local role 228 228 # of the same object has changed -
main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt
r7177 r7185 51 51 {'waeup.local.Owner': [<waeup.sirp.authentication.Account object at 0x...>]} 52 52 53 Users have also got the global PortalUser role:53 Users have also got the global AcademicsOfficer role: 54 54 55 55 >>> alice.getSiteRolesForPrincipal() 56 ['waeup. PortalUser']56 ['waeup.AcademicsOfficer'] 57 57 58 58 We can tell an account, that Alice got some role for another object: -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7178 r7185 145 145 >>> print root['myuniversity']['users']['bob'].roles 146 146 [] 147 >>> root['myuniversity']['users']['bob'].roles = ['waeup. PortalUser']147 >>> root['myuniversity']['users']['bob'].roles = ['waeup.ApplicationsOfficer'] 148 148 >>> print root['myuniversity']['users']['bob'].roles 149 ['waeup. PortalUser']149 ['waeup.ApplicationsOfficer'] 150 150 >>> browser.open('http://localhost/myuniversity/users') 151 151 >>> print browser.contents 152 152 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 153 ...<td> Portal User <br /></td>153 ...<td>Applications Officer <br /></td> 154 154 ... 155 155 … … 303 303 >>> browser.open('http://localhost/myuniversity/faculties/TF/manage') 304 304 >>> browser.getControl(name="user").value = ['bob'] 305 >>> browser.getControl(name="local_role").value = ['waeup.local.Department Officer']305 >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentManager'] 306 306 >>> browser.getControl("Add local role").click() 307 307 >>> print browser.contents … … 315 315 >>> print browser.contents 316 316 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 317 ...<td>Department Officer:...317 ...<td>Department Manager:... 318 318 ... 319 319 … … 330 330 >>> browser.open('http://localhost/myuniversity/faculties/TF/manage') 331 331 >>> ctrl = browser.getControl(name='role_id') 332 >>> ctrl.getControl(value='bob|waeup.local.Department Officer').selected = True332 >>> ctrl.getControl(value='bob|waeup.local.DepartmentManager').selected = True 333 333 >>> browser.getControl("Remove selected local roles").click() 334 334 >>> print browser.contents … … 459 459 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage') 460 460 >>> browser.getControl(name="user").value = ['bob'] 461 >>> browser.getControl(name="local_role").value = ['waeup.local.Department Officer']461 >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentManager'] 462 462 >>> browser.getControl("Add local role").click() 463 463 >>> print browser.contents … … 478 478 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage') 479 479 >>> ctrl = browser.getControl(name='role_id') 480 >>> ctrl.getControl(value='bob|waeup.local.Department Officer').selected = True480 >>> ctrl.getControl(value='bob|waeup.local.DepartmentManager').selected = True 481 481 >>> browser.getControl("Remove selected local roles").click() 482 482 >>> print browser.contents -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
r7184 r7185 50 50 51 51 # Local Roles 52 class Department Officer(grok.Role):53 grok.name('waeup.local.Department Officer')54 grok.title(u'Department Officer')52 class DepartmentManager(grok.Role): 53 grok.name('waeup.local.DepartmentManager') 54 grok.title(u'Department Manager') 55 55 grok.permissions('waeup.manageUniversity') 56 56 … … 75 75 76 76 # Site Roles 77 class PortalUser(grok.Role):78 grok.name('waeup. PortalUser')79 grok.title(u' Portal User')77 class AcademicsOfficer(grok.Role): 78 grok.name('waeup.AcademicsOfficer') 79 grok.title(u'Academics Offiver (view only)') 80 80 grok.permissions('waeup.viewAcademics') 81 81 -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt
r7181 r7185 53 53 >>> from waeup.sirp.permissions import getWAeUPRoleNames 54 54 >>> list(getWAeUPRoleNames()) 55 [u'waeup.ACManager', u'waeup.AccommodationOfficer', u'waeup.Applicant', 55 [u'waeup.ACManager', u'waeup.AcademicsOfficer', 56 u'waeup.AccommodationOfficer', u'waeup.Applicant', 56 57 u'waeup.ApplicationsOfficer', 57 u'waeup.PortalManager', u'waeup. PortalUser', u'waeup.Student',58 u'waeup.PortalManager', u'waeup.Student', 58 59 u'waeup.StudentsClearanceOfficer', u'waeup.StudentsManager', 59 60 u'waeup.StudentsOfficer'] -
main/waeup.sirp/trunk/src/waeup/sirp/university/department.py
r7137 r7185 15 15 @property # Make this method read_only and looking like an attr. 16 16 def local_roles(cls): 17 return ['waeup.local.Department Officer',17 return ['waeup.local.DepartmentManager', 18 18 'waeup.local.ClearanceOfficer',] 19 19 -
main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py
r7153 r7185 16 16 @property # Make this method read_only and looking like an attr. 17 17 def local_roles(cls): 18 return ['waeup.local.Department Officer',18 return ['waeup.local.DepartmentManager', 19 19 'waeup.local.ClearanceOfficer',] 20 20
Note: See TracChangeset for help on using the changeset viewer.