Changeset 6198 for main


Ignore:
Timestamp:
26 May 2011, 06:58:55 (14 years ago)
Author:
Henrik Bettermann
Message:

Convert waeup.local.ApplicationsOfficer? to waeup.ApplicationsOfficer?.
Change and simplify permission settings in application section.
Assign application section permissions to Portal Manager.

Actually we need a Campus Manager (Academics Section Manager) too. Then manageUniversity should be renamed to manageAcademics.

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  
    5959    access_code = index.Field(attribute='access_code')
    6060
    61 
    6261class ApplicantTraverser(grok.Traverser):
    6362    """Get image of the context applicant.
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6196 r6198  
    8989    grok.context(IApplicantsRoot)
    9090    grok.view(ApplicantsRootPage)
    91     grok.require('waeup.manageUniversity')
     91    grok.require('waeup.manageApplications')
    9292    text = 'Manage application section'
    9393
     
    9999    label = 'Manage application section'
    100100    pnav = 3
    101     grok.require('waeup.manageUniversity')
     101    grok.require('waeup.manageApplications')
    102102    taboneactions = ['Add applicants container', 'Remove selected','Cancel']
    103103    tabtwoactions1 = ['Remove selected local roles']
     
    164164class ApplicantsContainerAddFormPage(WAeUPAddFormPage):
    165165    grok.context(IApplicantsRoot)
    166     grok.require('waeup.manageUniversity')
     166    grok.require('waeup.manageApplications')
    167167    grok.name('add')
    168168    grok.template('applicantscontaineraddpage')
     
    236236    grok.context(IWAeUPObject)
    237237    grok.order(3)
    238     grok.require('waeup.manageUniversity')
     238    grok.require('waeup.manageApplications')
    239239    grok.template('primarynavtab')
    240240
     
    271271    grok.context(IApplicantsContainer)
    272272    grok.view(ApplicantsContainerPage)
     273    grok.require('waeup.manageApplications')
    273274    text = 'Manage applicants container'
    274275
     
    286287    form_fields['startdate'].custom_widget = FriendlyDateWidget('le')
    287288    form_fields['enddate'].custom_widget = FriendlyDateWidget('le')
    288     grok.require('waeup.manageUniversity')
     289    grok.require('waeup.manageApplications')
    289290
    290291    @property
     
    426427            applicant_object = get_applicant_data(access_code)
    427428            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>' % (
    429430                url,access_code)
    430431        return ''
     
    433434    grok.context(IApplicant)
    434435    grok.name('index')
    435     grok.require('waeup.viewApplication')
     436    grok.require('waeup.handleApplication')
    436437    form_fields = grok.AutoFields(IApplicant).omit('locked')
    437438    #form_fields['fst_sit_results'].custom_widget = list_results_display_widget
     
    450451        return '%s Application Record' % container_title
    451452
     453class 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
    452460class EditApplicantFull(WAeUPEditFormPage):
    453461    """A full edit view for applicant data.
     
    455463    grok.context(IApplicant)
    456464    grok.name('edit_full')
    457     grok.require('waeup.editFullApplication')
     465    grok.require('waeup.manageApplications')
    458466    form_fields = grok.AutoFields(IApplicant)   #.omit('locked')
    459467    form_fields['passport'].custom_widget = EncodingImageFileWidget
     
    488496    grok.context(IApplicantEdit)
    489497    grok.name('edit')
    490     grok.require('waeup.editApplication')
     498    grok.require('waeup.handleApplication')
    491499    form_fields = grok.AutoFields(IApplicantEdit).omit('locked')
    492500    form_fields['passport'].custom_widget = EncodingImageFileWidget
     
    501509    def update(self):
    502510        if self.context.locked:
    503             self.emitLockMessage()
     511            self.redirect(self.url(self.context))
    504512            return
    505513        datepicker.need() # Enable jQuery datepicker in date fields.
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/container.py

    r6184 r6198  
    5252    @property
    5353    def local_roles(cls):
    54         return ['waeup.local.ApplicationsOfficer']
     54        return ['waeup.ApplicationsOfficer']
    5555
    5656    def archive(self, app_ids=None):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/permissions.py

    r6184 r6198  
    2626
    2727# Application permissions
    28 class ViewApplication(grok.Permission):
    29     grok.name('waeup.viewApplication')
    3028
    31 class ViewFullApplication(grok.Permission):
    32     grok.name('waeup.viewFullApplication')
     29class HandleApplication(grok.Permission):
     30    grok.name('waeup.handleApplication')
    3331
    34 class EditApplication(grok.Permission):
    35     grok.name('waeup.editApplication')
     32class ManageApplications(grok.Permission):
     33    grok.name('waeup.manageApplications')
    3634
    37 class EditFullApplication(grok.Permission):
    38     grok.name('waeup.editFullApplication')
    39 
    40 # Local roles
     35# Local role
    4136class ApplicationOwner(grok.Role):
    4237    grok.name('waeup.local.ApplicationOwner')
    4338    grok.title(u'Application Owner')
    44     grok.permissions('waeup.viewApplication', 'waeup.editApplication')
     39    grok.permissions('waeup.handleApplication')
    4540
     41# Global role
    4642class ApplicationsOfficer(grok.Role):
    47     grok.name('waeup.local.ApplicationsOfficer')
     43    grok.name('waeup.ApplicationsOfficer')
    4844    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  
    3939    @property
    4040    def local_roles(cls):
    41         return ['waeup.local.ApplicationsOfficer']
     41        return ['waeup.ApplicationsOfficer']
    4242
    4343class ApplicantsPlugin(grok.GlobalUtility):
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.py

    r6173 r6198  
    5757    grok.permissions('waeup.manageUniversity', 'waeup.manageUsers',
    5858                     'waeup.View', 'waeup.Public','waeup.manageACBatches',
    59                      'waeup.manageDataCenter','waeup.managePortalSettings')
     59                     'waeup.manageDataCenter','waeup.managePortalSettings',
     60                     'waeup.manageApplications', 'waeup.handleApplication')
    6061
    6162def getRoles():
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt

    r6185 r6198  
    2929
    3030    >>> sorted(list(getRoles()))
    31     [(u'waeup.PortalManager', <waeup...PortalManager object at 0x...>), ...]
     31    [(u'waeup.ApplicationsOfficer', <waeup.sirp.applicants.permissions.ApplicationsOfficer object at 0x...>), ...]
    3232
    3333:func:`getWAeUPRoles`
     
    3939    >>> from waeup.sirp.permissions import getWAeUPRoles
    4040    >>> len(list(getWAeUPRoles()))
    41     2
     41    3
    4242
    4343    >>> len(list(getWAeUPRoles(also_local=True)))
     
    5353    >>> from waeup.sirp.permissions import getWAeUPRoleNames
    5454    >>> 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.