Changeset 10226
- Timestamp:
- 24 May 2013, 17:54:10 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/dynamicroles.py
r8964 r10226 42 42 # role to add in case this role was found 43 43 rolename_mapping = { 44 'waeup.local. ClearanceOfficer':'waeup.ApplicationsOfficer',44 'waeup.local.ApplicationsManager':'waeup.ApplicationsManager', 45 45 } 46 46 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/permissions.py
r8565 r10226 60 60 class ApplicationsOfficer(grok.Role): 61 61 grok.name('waeup.ApplicationsOfficer') 62 grok.title(u'Applications Officer') 62 grok.title(u'Applications Officer (view only)') 63 grok.permissions('waeup.viewApplication', 'waeup.viewApplicantsTab') 64 65 class ApplicationsManager(grok.Role): 66 grok.name('waeup.ApplicationsManager') 67 grok.title(u'Applications Manager') 63 68 grok.permissions('waeup.manageApplication', 'waeup.viewApplication', 64 69 'waeup.viewApplicantsTab', 'waeup.payApplicant') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r10210 r10226 297 297 return 298 298 299 # We have no local roles yet 300 #def test_local_roles_add_delete(self): 301 # # Managers can assign and delete local roles of applicants root 302 # myusers = self.app['users'] 303 # myusers.addUser('bob', 'bobssecret') 304 # self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 305 # self.browser.open(self.manage_root_path) 306 # self.browser.getControl(name="user").value = ['bob'] 307 # self.browser.getControl(name="local_role").value = [ 308 # 'waeup.local.ApplicationsOfficer'] 309 # self.browser.getControl("Add local role").click() 310 # self.assertTrue('<td>bob</td>' in self.browser.contents) 311 # # Remove the role assigned 312 # ctrl = self.browser.getControl(name='role_id') 313 # ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 314 # self.browser.getControl("Remove selected local roles").click() 315 # self.assertTrue('Successfully removed:' in self.browser.contents) 316 # self.assertFalse('<td>bob</td>' in self.browser.contents) 317 # return 299 def test_local_roles_add_delete(self): 300 # Managers can assign and delete local roles of applicants root 301 myusers = self.app['users'] 302 myusers.addUser('bob', 'bobssecret') 303 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 304 self.browser.open('http://localhost/app/faculties/fac1/dep1/manage') 305 self.browser.getControl(name="user").value = ['bob'] 306 self.browser.getControl(name="local_role").value = [ 307 'waeup.local.ApplicationsManager'] 308 self.browser.getControl("Add local role").click() 309 self.assertTrue('<td>bob</td>' in self.browser.contents) 310 # Remove the role assigned 311 ctrl = self.browser.getControl(name='role_id') 312 ctrl.getControl( 313 value='bob|waeup.local.ApplicationsManager').selected = True 314 self.browser.getControl("Remove selected local roles").click() 315 self.assertTrue( 316 'Local role successfully removed: bob|waeup.local.ApplicationsManager' 317 in self.browser.contents) 318 self.assertFalse('<td>bob</td>' in self.browser.contents) 319 return 318 320 319 321 def test_add_delete_container(self): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_dynamicroles.py
r7811 r10226 47 47 super(ApplicantPrincipalRoleManagerFunctionalTests, self).setUp() 48 48 self.applicant.course1 = self.certificate 49 self.officer_role = 'waeup.ApplicationsOfficer' 50 # assign clearance permissions for a virtual officer 49 # assign application manage permissions for a virtual officer 51 50 prm = IPrincipalRoleManager(self.department) 52 prm.assignRoleToPrincipal('waeup.local. ClearanceOfficer', 'alice')51 prm.assignRoleToPrincipal('waeup.local.ApplicationsManager', 'alice') 53 52 return 54 53 … … 78 77 79 78 def test_valid_officer(self): 80 # for an officer that has clearance role on the connected dept 81 # we get the ApplicationsOfficer role on our applicant 79 # for an officer that has application manage permissions 80 # on the connected dept 81 # we get the ApplicationsManager role on our applicant 82 82 prm = IPrincipalRoleManager(self.applicant) 83 83 result = prm.getRolesForPrincipal('alice') 84 self.assertEqual(result, [('waeup.Applications Officer', Allow)])84 self.assertEqual(result, [('waeup.ApplicationsManager', Allow)]) 85 85 return -
main/waeup.kofa/trunk/src/waeup/kofa/browser/browser.txt
r10207 r10226 217 217 >>> print browser.contents 218 218 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 219 ...<td nowrap>Applications Officer <br /></td>219 ...<td nowrap>Applications Officer (view only) <br /></td> 220 220 ... 221 221 -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r10177 r10226 78 78 79 79 # Local Roles 80 class ApplicationsManager(grok.Role): 81 grok.name('waeup.local.ApplicationsManager') 82 grok.title(u'Applications Manager') 83 grok.permissions('waeup.viewAcademics') 84 80 85 class DepartmentManager(grok.Role): 81 86 grok.name('waeup.local.DepartmentManager') -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.txt
r10177 r10226 39 39 >>> from waeup.kofa.permissions import get_waeup_roles 40 40 >>> len(list(get_waeup_roles())) 41 2 041 21 42 42 43 43 >>> len(list(get_waeup_roles(also_local=True))) 44 3 644 38 45 45 46 46 … … 58 58 u'waeup.AccommodationOfficer', 59 59 u'waeup.Applicant', 60 u'waeup.ApplicationsManager', 60 61 u'waeup.ApplicationsOfficer', 61 62 u'waeup.CCOfficer', -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_dynamicroles.py
r8963 r10226 82 82 def test_valid_officer(self): 83 83 # for an officer that has clearance role on the connected dept 84 # we get the ApplicationsOfficer role on our student84 # we get the ClearanceOfficer role on our student 85 85 prm = IPrincipalRoleManager(self.student) 86 86 result = prm.getRolesForPrincipal('alice') -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r10064 r10226 39 39 40 40 local_roles = [ 41 'waeup.local.ApplicationsManager', 41 42 'waeup.local.DepartmentManager', 42 43 'waeup.local.ClearanceOfficer',
Note: See TracChangeset for help on using the changeset viewer.