Changeset 6367 for main


Ignore:
Timestamp:
14 Jun 2011, 14:06:02 (14 years ago)
Author:
Henrik Bettermann
Message:

Add view permission for applicants to render view and edit buttons correctly.

Reenable transtion 'start' after first login.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6366 r6367  
    422422            return
    423423        pin = self.request.principal.access_code
     424        state = IWorkflowState(self.context[pin]).getState()
     425        if state == INITIALIZED:
     426            IWorkflowInfo(self.context[pin]).fireTransition('start')
    424427        if pin in self.context.keys():
    425428            self.redirect(self.url(self.context[pin], 'edit'))
     
    443446        role_manager.assignRoleToPrincipal(
    444447            'waeup.PortalUser', self.request.principal.id)
    445         # XXX: disable for now. Pins will get a different workflow.
    446         #state = IWorkflowState(self.context[pin]).getState()
    447         #if state == INITIALIZED:
    448         #    IWorkflowInfo(self.context[pin]).fireTransition('start')
    449448        self.redirect(self.url(self.context[pin], 'edit'))
    450449        return
     
    536535    grok.require('waeup.handleApplication')
    537536    icon = 'actionicon_pdf.png'
    538     text = 'Application slip'
     537    text = 'Download application slip'
    539538    target = 'application_slip.pdf'
    540539
     
    650649    target = 'edit_full'
    651650
     651class ApplicantEditActionButton(ManageActionButton):
     652    grok.context(IApplicant)
     653    grok.view(DisplayApplicant)
     654    grok.require('waeup.handleApplication')
     655    text = 'Edit application record'
     656    target = 'edit'
     657
    652658class EditApplicantFull(WAeUPEditFormPage):
    653659    """A full edit view for applicant data.
     
    721727    def update(self):
    722728        if self.context.locked:
    723             self.redirect(self.url(self.context))
     729            self.emitLockMessage()
    724730            return
    725731        datepicker.need() # Enable jQuery datepicker in date fields.
     
    766772        return
    767773
     774class ApplicantViewActionButton(ManageActionButton):
     775    grok.context(IApplicant)
     776    grok.view(EditApplicantStudent)
     777    grok.require('waeup.handleApplication')
     778    text = 'View application record'
     779    target = 'index'
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/permissions.py

    r6198 r6367  
    3030    grok.name('waeup.handleApplication')
    3131
     32class ViewApplication(grok.Permission):
     33    grok.name('waeup.viewApplication')
     34
    3235class ManageApplications(grok.Permission):
    3336    grok.name('waeup.manageApplications')
     
    3740    grok.name('waeup.local.ApplicationOwner')
    3841    grok.title(u'Application Owner')
    39     grok.permissions('waeup.handleApplication')
     42    grok.permissions('waeup.handleApplication', 'waeup.viewApplication')
    4043
    4144# Global role
     
    4346    grok.name('waeup.ApplicationsOfficer')
    4447    grok.title(u'Applications Officer')
    45     grok.permissions('waeup.manageApplications', 'waeup.handleApplication')
     48    grok.permissions('waeup.manageApplications', 'waeup.viewApplication')
Note: See TracChangeset for help on using the changeset viewer.