Changeset 7181 for main


Ignore:
Timestamp:
24 Nov 2011, 05:52:34 (13 years ago)
Author:
Henrik Bettermann
Message:

StudentsOfficers? are not allowed to view the accommodation and payments containers of students. We therefore use the dedicated permissions waeup.handleAccommodation and waeup.payStudent.

Add role waeup.ACManager with permission waeup.manageACBatches which has already been uses in accesscodes.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscode.py

    r7137 r7181  
    1919    )
    2020from waeup.sirp.accesscodes.workflow import DISABLED, USED
    21 
    22 class ManageACBatches(grok.Permission):
    23     grok.name('waeup.manageACBatches')
    2421
    2522class AccessCode(grok.Model):
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.py

    r7178 r7181  
    4141    grok.name('waeup.managePortalConfiguration')
    4242
     43class ManageACBatches(grok.Permission):
     44    grok.name('waeup.manageACBatches')
     45
    4346# Local Roles
    4447class DepartmentOfficer(grok.Role):
     
    7275    grok.title(u'Portal User')
    7376    grok.permissions('waeup.View', 'waeup.Public')
     77
     78class ACManager(grok.Role):
     79    grok.name('waeup.ACManager')
     80    grok.title(u'Access Code Manager')
     81    grok.permissions('waeup.manageACBatches')
    7482
    7583class PortalManager(grok.Role):
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt

    r7177 r7181  
    2929
    3030    >>> sorted(list(getAllRoles()))
    31     [(u'waeup.AccommodationOfficer', <waeup.sirp.hostels.permissions.AccommodationOfficer object at 0x...]
     31    [(u'waeup.ACManager', <waeup.sirp.permissions.ACManager object at 0x...]
    3232
    3333:func:`getWAeUPRoles`
     
    3939    >>> from waeup.sirp.permissions import getWAeUPRoles
    4040    >>> len(list(getWAeUPRoles()))
    41     9
     41    10
    4242
    4343    >>> len(list(getWAeUPRoles(also_local=True)))
    44     15
     44    16
    4545
    4646
     
    5353    >>> from waeup.sirp.permissions import getWAeUPRoleNames
    5454    >>> list(getWAeUPRoleNames())
    55     [u'waeup.AccommodationOfficer', u'waeup.Applicant',
     55    [u'waeup.ACManager', u'waeup.AccommodationOfficer', u'waeup.Applicant',
    5656     u'waeup.ApplicationsOfficer',
    5757     u'waeup.PortalManager', u'waeup.PortalUser', u'waeup.Student',
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7171 r7181  
    948948    grok.context(IStudentPaymentsContainer)
    949949    grok.name('index')
    950     grok.require('waeup.handleStudent')
     950    grok.require('waeup.payStudent')
    951951    form_fields = grok.AutoFields(IStudentPaymentsContainer)
    952952    grok.template('paymentsmanagepage')
     
    10181018    grok.context(IStudentPaymentsContainer)
    10191019    grok.name('addop')
    1020     grok.require('waeup.handleStudent')
     1020    grok.require('waeup.payStudent')
    10211021    form_fields = grok.AutoFields(IStudentOnlinePayment).select(
    10221022        'p_category')
     
    11101110    grok.context(IStudentOnlinePayment)
    11111111    grok.view(OnlinePaymentDisplayFormPage)
    1112     grok.require('waeup.handleStudent')
     1112    grok.require('waeup.payStudent')
    11131113    icon = 'actionicon_call.png'
    11141114    text = 'Request callback'
     
    12181218    grok.context(IStudentAccommodation)
    12191219    grok.name('index')
    1220     grok.require('waeup.handleStudent')
     1220    grok.require('waeup.handleAccommodation')
    12211221    form_fields = grok.AutoFields(IStudentAccommodation)
    12221222    grok.template('accommodationmanagepage')
     
    12831283    grok.context(IStudentAccommodation)
    12841284    grok.view(AccommodationManageFormPage)
    1285     grok.require('waeup.handleStudent')
     1285    grok.require('waeup.handleAccommodation')
    12861286    icon = 'actionicon_home.png'
    12871287    text = 'Book accommodation'
     
    12931293    grok.context(IStudentAccommodation)
    12941294    grok.name('add')
    1295     grok.require('waeup.handleStudent')
     1295    grok.require('waeup.handleAccommodation')
    12961296    grok.template('enterpin')
    12971297    ac_prefix = 'HOS'
     
    13841384    grok.context(IBedTicket)
    13851385    grok.name('index')
    1386     grok.require('waeup.viewStudent')
     1386    grok.require('waeup.handleAccommodation')
    13871387    form_fields = grok.AutoFields(IBedTicket)
    13881388    form_fields[
     
    14021402    grok.context(IBedTicket)
    14031403    grok.view(BedTicketDisplayFormPage)
    1404     grok.require('waeup.viewStudent')
     1404    grok.require('waeup.handleAccommodation')
    14051405    icon = 'actionicon_pdf.png'
    14061406    text = 'Download bed allocation slip'
     
    14121412    grok.context(IBedTicket)
    14131413    grok.name('bed_allocation.pdf')
    1414     grok.require('waeup.viewStudent')
     1414    grok.require('waeup.handleAccommodation')
    14151415    form_fields = grok.AutoFields(IBedTicket)
    14161416    form_fields['booking_date'].custom_widget = FriendlyDateDisplayWidget('le')
  • main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py

    r7178 r7181  
    3030    grok.name('waeup.payStudent')
    3131
     32class HandleAccommodation(grok.Permission):
     33    grok.name('waeup.handleAccommodation')
     34
    3235class UploadStudentFile(grok.Permission):
    3336    grok.name('waeup.uploadStudentFile')
     
    4447    grok.title(u'Student Record Owner')
    4548    grok.permissions('waeup.handleStudent', 'waeup.uploadStudentFile',
    46                      'waeup.viewStudent', 'waeup.payStudent')
     49                     'waeup.viewStudent', 'waeup.payStudent',
     50                     'waeup.handleAccommodation')
    4751
    4852# Site Roles
     
    6064    grok.title(u'Students Manager')
    6165    grok.permissions('waeup.viewStudent', 'waeup.manageStudent',
    62                      'waeup.payStudent', 'waeup.uploadStudentFile')
     66                     'waeup.payStudent', 'waeup.uploadStudentFile',
     67                     'waeup.handleAccommodation')
    6368
    6469class StudentsClearanceOfficer(grok.Role):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7136 r7181  
    6363class StudentManagePaymentsLink(StudentManageLink):
    6464    grok.order(4)
     65    grok.require('waeup.payStudent')
    6566    link = 'payments'
    6667    text = u'Payments'
     
    6869class StudentManageAccommodationLink(StudentManageLink):
    6970    grok.order(5)
     71    grok.require('waeup.handleAccommodation')
    7072    link = 'accommodation'
    7173    text = u'Accommodation Data'
Note: See TracChangeset for help on using the changeset viewer.