Changeset 5937
- Timestamp:
- 13 Apr 2011, 08:53:45 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r5928 r5937 29 29 from zope.component import getUtility, getAllUtilitiesRegisteredFor 30 30 from zope.formlib.widgets import FileWidget, DateWidget 31 from zope.securitypolicy.interfaces import IPrincipalRoleManager 31 32 from waeup.sirp.browser import ( 32 33 WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage, … … 313 314 applicant.access_code = pin 314 315 self.context[pin] = applicant 315 # XXX: set owner role on created applicant 316 317 self.redirect(self.url(self.context[pin])) 316 317 # Assign current principal the owner role on created applicant 318 # record 319 role_manager = IPrincipalRoleManager(self.context) 320 role_manager.assignRoleToPrincipal( 321 'waeup.ApplicationOwner', self.request.principal.id) 322 self.redirect(self.url(self.context[pin], 'edit')) 318 323 return 319 324 … … 345 350 grok.context(IApplicant) 346 351 grok.name('index') 352 grok.require('waeup.viewApplication') 347 353 form_fields = grok.AutoFields(IApplicant) 348 354 form_fields['fst_sit_results'].custom_widget = list_results_display_widget … … 357 363 grok.context(IApplicant) 358 364 grok.name('edit') 365 grok.require('waeup.editApplication') 359 366 form_fields = grok.AutoFields(IApplicantPDEEditData) 360 367 #form_fields['passport'].custom_widget = FileWidget -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
r5433 r5937 30 30 class FacultyRead(grok.Permission): 31 31 grok.name('waeup.facultyread') 32 32 33 # Application permissions 34 class ViewApplication(grok.Permission): 35 grok.name('waeup.viewApplication') 36 37 class ViewFullApplication(grok.Permission): 38 grok.name('waeup.viewFullApplication') 39 40 class EditApplication(grok.Permission): 41 grok.name('waeup.editApplication') 42 43 class EditFullApplication(grok.Permission): 44 grok.name('waeup.editFullApplication') 45 46 # Roles 33 47 class PortalUser(grok.Role): 34 48 grok.name('waeup.PortalUser') … … 40 54 'waeup.View', 'waeup.Public','waeup.manageACBatches') 41 55 56 class ApplicationOwner(grok.Role): 57 grok.name('waeup.ApplicationOwner') 58 grok.permissions('waeup.viewApplication', 'waeup.editApplication') 59 42 60 def getRoles(): 43 61 app = grok.getSite()
Note: See TracChangeset for help on using the changeset viewer.