- Timestamp:
- 26 May 2011, 06:58:55 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py
r6196 r6198 59 59 access_code = index.Field(attribute='access_code') 60 60 61 62 61 class ApplicantTraverser(grok.Traverser): 63 62 """Get image of the context applicant. -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6196 r6198 89 89 grok.context(IApplicantsRoot) 90 90 grok.view(ApplicantsRootPage) 91 grok.require('waeup.manage University')91 grok.require('waeup.manageApplications') 92 92 text = 'Manage application section' 93 93 … … 99 99 label = 'Manage application section' 100 100 pnav = 3 101 grok.require('waeup.manage University')101 grok.require('waeup.manageApplications') 102 102 taboneactions = ['Add applicants container', 'Remove selected','Cancel'] 103 103 tabtwoactions1 = ['Remove selected local roles'] … … 164 164 class ApplicantsContainerAddFormPage(WAeUPAddFormPage): 165 165 grok.context(IApplicantsRoot) 166 grok.require('waeup.manage University')166 grok.require('waeup.manageApplications') 167 167 grok.name('add') 168 168 grok.template('applicantscontaineraddpage') … … 236 236 grok.context(IWAeUPObject) 237 237 grok.order(3) 238 grok.require('waeup.manage University')238 grok.require('waeup.manageApplications') 239 239 grok.template('primarynavtab') 240 240 … … 271 271 grok.context(IApplicantsContainer) 272 272 grok.view(ApplicantsContainerPage) 273 grok.require('waeup.manageApplications') 273 274 text = 'Manage applicants container' 274 275 … … 286 287 form_fields['startdate'].custom_widget = FriendlyDateWidget('le') 287 288 form_fields['enddate'].custom_widget = FriendlyDateWidget('le') 288 grok.require('waeup.manage University')289 grok.require('waeup.manageApplications') 289 290 290 291 @property … … 426 427 applicant_object = get_applicant_data(access_code) 427 428 url = absoluteURL(applicant_object, self.request) 428 return u'<div class="portlet"><a href="%s ">%s</a></div>' % (429 return u'<div class="portlet"><a href="%s/edit">%s</a></div>' % ( 429 430 url,access_code) 430 431 return '' … … 433 434 grok.context(IApplicant) 434 435 grok.name('index') 435 grok.require('waeup. viewApplication')436 grok.require('waeup.handleApplication') 436 437 form_fields = grok.AutoFields(IApplicant).omit('locked') 437 438 #form_fields['fst_sit_results'].custom_widget = list_results_display_widget … … 450 451 return '%s Application Record' % container_title 451 452 453 class ApplicantsManageActionButton(ManageActionButton): 454 grok.context(IApplicant) 455 grok.view(DisplayApplicant) 456 grok.require('waeup.manageApplications') 457 text = 'Edit application record' 458 target = 'edit_full' 459 452 460 class EditApplicantFull(WAeUPEditFormPage): 453 461 """A full edit view for applicant data. … … 455 463 grok.context(IApplicant) 456 464 grok.name('edit_full') 457 grok.require('waeup. editFullApplication')465 grok.require('waeup.manageApplications') 458 466 form_fields = grok.AutoFields(IApplicant) #.omit('locked') 459 467 form_fields['passport'].custom_widget = EncodingImageFileWidget … … 488 496 grok.context(IApplicantEdit) 489 497 grok.name('edit') 490 grok.require('waeup. editApplication')498 grok.require('waeup.handleApplication') 491 499 form_fields = grok.AutoFields(IApplicantEdit).omit('locked') 492 500 form_fields['passport'].custom_widget = EncodingImageFileWidget … … 501 509 def update(self): 502 510 if self.context.locked: 503 self. emitLockMessage()511 self.redirect(self.url(self.context)) 504 512 return 505 513 datepicker.need() # Enable jQuery datepicker in date fields. -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/container.py
r6184 r6198 52 52 @property 53 53 def local_roles(cls): 54 return ['waeup. local.ApplicationsOfficer']54 return ['waeup.ApplicationsOfficer'] 55 55 56 56 def archive(self, app_ids=None): -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/permissions.py
r6184 r6198 26 26 27 27 # Application permissions 28 class ViewApplication(grok.Permission):29 grok.name('waeup.viewApplication')30 28 31 class ViewFullApplication(grok.Permission):32 grok.name('waeup. viewFullApplication')29 class HandleApplication(grok.Permission): 30 grok.name('waeup.handleApplication') 33 31 34 class EditApplication(grok.Permission):35 grok.name('waeup. editApplication')32 class ManageApplications(grok.Permission): 33 grok.name('waeup.manageApplications') 36 34 37 class EditFullApplication(grok.Permission): 38 grok.name('waeup.editFullApplication') 39 40 # Local roles 35 # Local role 41 36 class ApplicationOwner(grok.Role): 42 37 grok.name('waeup.local.ApplicationOwner') 43 38 grok.title(u'Application Owner') 44 grok.permissions('waeup. viewApplication', 'waeup.editApplication')39 grok.permissions('waeup.handleApplication') 45 40 41 # Global role 46 42 class ApplicationsOfficer(grok.Role): 47 grok.name('waeup. local.ApplicationsOfficer')43 grok.name('waeup.ApplicationsOfficer') 48 44 grok.title(u'Applications Officer') 49 grok.permissions('waeup. viewFullApplication', 'waeup.editFullApplication')45 grok.permissions('waeup.manageApplications', 'waeup.handleApplication') -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py
r6184 r6198 39 39 @property 40 40 def local_roles(cls): 41 return ['waeup. local.ApplicationsOfficer']41 return ['waeup.ApplicationsOfficer'] 42 42 43 43 class ApplicantsPlugin(grok.GlobalUtility): -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
r6173 r6198 57 57 grok.permissions('waeup.manageUniversity', 'waeup.manageUsers', 58 58 'waeup.View', 'waeup.Public','waeup.manageACBatches', 59 'waeup.manageDataCenter','waeup.managePortalSettings') 59 'waeup.manageDataCenter','waeup.managePortalSettings', 60 'waeup.manageApplications', 'waeup.handleApplication') 60 61 61 62 def getRoles(): -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt
r6185 r6198 29 29 30 30 >>> sorted(list(getRoles())) 31 [(u'waeup. PortalManager', <waeup...PortalManager object at 0x...>), ...]31 [(u'waeup.ApplicationsOfficer', <waeup.sirp.applicants.permissions.ApplicationsOfficer object at 0x...>), ...] 32 32 33 33 :func:`getWAeUPRoles` … … 39 39 >>> from waeup.sirp.permissions import getWAeUPRoles 40 40 >>> len(list(getWAeUPRoles())) 41 241 3 42 42 43 43 >>> len(list(getWAeUPRoles(also_local=True))) … … 53 53 >>> from waeup.sirp.permissions import getWAeUPRoleNames 54 54 >>> list(getWAeUPRoleNames()) 55 [u'waeup. PortalManager', u'waeup.PortalUser']55 [u'waeup.ApplicationsOfficer', u'waeup.PortalManager', u'waeup.PortalUser']
Note: See TracChangeset for help on using the changeset viewer.