Ignore:
Timestamp:
24 Nov 2011, 09:20:13 (13 years ago)
Author:
Henrik Bettermann
Message:

Reorganise permissions:

The navigation viewlets now manage the permission requirements themselves. No need to do this in pagetemplates.

Rename permission waeup.View to waeup.viewAcademics because it only refers to the academic section.

Add permission waeup.Authenticated (which is used in students). The StudentRecordOwner? explicitly needs this permission. Otherwise the MyData? tab disappears when changing the password.

Roles do not need to get the waeup.Public permission. This is already guaranteed in site.zcml.

File:
1 edited

Legend:

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

    r7166 r7184  
    234234        return self.context.access_code
    235235
    236 class ApplicantsTab(PrimaryNavTab):
     236class ApplicantsAuthTab(PrimaryNavTab):
    237237    """Applicants tab in primary navigation.
    238238    """
    239 
    240239    grok.context(IWAeUPObject)
    241240    grok.order(3)
    242     grok.require('waeup.Public')
     241    grok.require('waeup.viewApplication')
    243242    grok.template('primarynavtab')
    244 
    245243    pnav = 3
    246244    tab_title = u'Applicants'
     
    249247    def link_target(self):
    250248        return self.view.application_url('applicants')
     249
     250class 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
    251268
    252269class ApplicantsContainerPage(WAeUPDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.