Changeset 7184 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 24 Nov 2011, 09:20:13 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7166 r7184 234 234 return self.context.access_code 235 235 236 class Applicants Tab(PrimaryNavTab):236 class ApplicantsAuthTab(PrimaryNavTab): 237 237 """Applicants tab in primary navigation. 238 238 """ 239 240 239 grok.context(IWAeUPObject) 241 240 grok.order(3) 242 grok.require('waeup. Public')241 grok.require('waeup.viewApplication') 243 242 grok.template('primarynavtab') 244 245 243 pnav = 3 246 244 tab_title = u'Applicants' … … 249 247 def link_target(self): 250 248 return self.view.application_url('applicants') 249 250 class ApplicantsAnonTab(ApplicantsAuthTab): 251 """Applicants tab in primary navigation. 252 253 Display tab only for anonymous. Authenticated users can call the 254 form from the user navigation bar. 255 """ 256 grok.require('waeup.Anonymous') 257 tab_title = u'Application' 258 259 # Also zope.manager has role Anonymous. 260 # To avoid displaying this tab, uncomment the following. 261 #def tab_title(self): 262 # userid = self.request.principal.id 263 # if userid != 'zope.anybody': 264 # tt = u'' 265 # else: 266 # tt = u'Application' 267 # return tt 251 268 252 269 class ApplicantsContainerPage(WAeUPDisplayFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/permissions.py
r7178 r7184 46 46 class ApplicantRole(grok.Role): 47 47 grok.name('waeup.Applicant') 48 grok.permissions('waeup. Public', 'waeup.View')48 grok.permissions('waeup.viewAcademics') 49 49 50 50 class ApplicationsOfficer(grok.Role): -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r7137 r7184 138 138 'Manage' in self.browser.contents) 139 139 140 140 141 def test_anonymous_no_actions(self): 141 142 # Make sure anonymous users cannot access actions … … 173 174 return 174 175 175 def test_local_roles_add_delete(self): 176 # Managers can assign and delete local roles of applicants root 177 myusers = self.app['users'] 178 myusers.addUser('bob', 'bobssecret') 179 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 180 self.browser.open(self.manage_root_path) 181 self.browser.getControl(name="user").value = ['bob'] 182 self.browser.getControl(name="local_role").value = [ 183 'waeup.ApplicationsOfficer'] 184 self.browser.getControl("Add local role").click() 185 self.assertTrue('<td>bob</td>' in self.browser.contents) 186 # Remove the role assigned 187 ctrl = self.browser.getControl(name='role_id') 188 ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 189 self.browser.getControl("Remove selected local roles").click() 190 self.assertTrue('Successfully removed:' in self.browser.contents) 191 self.assertFalse('<td>bob</td>' in self.browser.contents) 192 return 176 # We have no local roles yet 177 #def test_local_roles_add_delete(self): 178 # # Managers can assign and delete local roles of applicants root 179 # myusers = self.app['users'] 180 # myusers.addUser('bob', 'bobssecret') 181 # self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 182 # self.browser.open(self.manage_root_path) 183 # self.browser.getControl(name="user").value = ['bob'] 184 # self.browser.getControl(name="local_role").value = [ 185 # 'waeup.local.ApplicationsOfficer'] 186 # self.browser.getControl("Add local role").click() 187 # self.assertTrue('<td>bob</td>' in self.browser.contents) 188 # # Remove the role assigned 189 # ctrl = self.browser.getControl(name='role_id') 190 # ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 191 # self.browser.getControl("Remove selected local roles").click() 192 # self.assertTrue('Successfully removed:' in self.browser.contents) 193 # self.assertFalse('<td>bob</td>' in self.browser.contents) 194 # return 193 195 194 196 def test_add_delete_container(self): … … 423 425 return 424 426 425 def test_local_roles_add_delete(self): 426 # Managers can assign and delete local roles of applicants containers 427 myusers = self.app['users'] 428 myusers.addUser('bob', 'bobssecret') 429 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 430 self.browser.open(self.manage_container_path) 431 self.browser.getControl(name="user").value = ['bob'] 432 self.browser.getControl(name="local_role").value = [ 433 'waeup.ApplicationsOfficer'] 434 self.browser.getControl("Add local role").click() 435 self.assertTrue('<td>bob</td>' in self.browser.contents) 436 ctrl = self.browser.getControl(name='role_id') 437 ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 438 self.browser.getControl("Remove selected local roles").click() 439 self.assertTrue('Successfully removed:' in self.browser.contents) 440 self.assertFalse('<td>bob</td>' in self.browser.contents) 441 return 427 # We have no local roles yet 428 #def test_local_roles_add_delete(self): 429 # # Managers can assign and delete local roles of applicants containers 430 # myusers = self.app['users'] 431 # myusers.addUser('bob', 'bobssecret') 432 # self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 433 # self.browser.open(self.manage_container_path) 434 # self.browser.getControl(name="user").value = ['bob'] 435 # self.browser.getControl(name="local_role").value = [ 436 # 'waeup.local.ApplicationsOfficer'] 437 # self.browser.getControl("Add local role").click() 438 # self.assertTrue('<td>bob</td>' in self.browser.contents) 439 # ctrl = self.browser.getControl(name='role_id') 440 # ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 441 # self.browser.getControl("Remove selected local roles").click() 442 # self.assertTrue('Successfully removed:' in self.browser.contents) 443 # self.assertFalse('<td>bob</td>' in self.browser.contents) 444 # return 442 445 443 446 class LoginTest(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.