Changeset 6660 for main/waeup.sirp/trunk


Ignore:
Timestamp:
2 Sep 2011, 15:55:06 (13 years ago)
Author:
Henrik Bettermann
Message:

Add permission waeup.handleStudent and local role StudentRecordOwner? for students.

Change permission name from waeup.viewStudents to waeup.viewStudent. This permission can be applied to one student (by assigning the role StudentRecordOwner?) in contrast to waeup.manageStudents which will only be applicable to a group of students.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt

    r6655 r6660  
    4242
    4343    >>> len(list(getWAeUPRoles(also_local=True)))
    44     8
     44    9
    4545
    4646
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6654 r6660  
    7676    grok.context(IWAeUPObject)
    7777    grok.order(3)
    78     grok.require('waeup.viewStudents')
     78    grok.require('waeup.viewStudent')
    7979    grok.template('primarynavtab')
    8080
     
    115115    grok.context(IStudentsContainer)
    116116    grok.name('index')
    117     grok.require('waeup.viewStudents')
     117    grok.require('waeup.viewStudent')
    118118    grok.template('studentscontainerpage')
    119119    label = 'Student Section'
     
    231231    grok.context(IStudent)
    232232    grok.name('index')
    233     grok.require('waeup.viewStudents')
     233    grok.require('waeup.viewStudent')
    234234    grok.template('studentpage')
    235235    form_fields = grok.AutoFields(IStudentBase)
     
    299299    grok.context(IStudent)
    300300    grok.name('view_clearance')
    301     grok.require('waeup.viewStudents')
     301    grok.require('waeup.viewStudent')
    302302    form_fields = grok.AutoFields(IStudentClearance)
    303303    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
     
    339339    grok.context(IStudent)
    340340    grok.name('view_personal')
    341     grok.require('waeup.viewStudents')
     341    grok.require('waeup.viewStudent')
    342342    form_fields = grok.AutoFields(IStudentPersonal)
    343343    title = 'Personal Data'
     
    361361    grok.context(IStudent)
    362362    grok.name('edit_personal')
    363     grok.require('waeup.viewStudents')
     363    grok.require('waeup.viewStudent')
    364364    form_fields = grok.AutoFields(IStudentPersonal)
    365365    label = 'Edit personal data'
     
    372372    grok.context(IStudentStudyCourse)
    373373    grok.name('index')
    374     grok.require('waeup.viewStudents')
     374    grok.require('waeup.viewStudent')
    375375    form_fields = grok.AutoFields(IStudentStudyCourse)
    376376    #grok.template('studycoursepage')
     
    407407    grok.context(IStudentPayments)
    408408    grok.name('index')
    409     grok.require('waeup.viewStudents')
     409    grok.require('waeup.viewStudent')
    410410    form_fields = grok.AutoFields(IStudentPayments)
    411411    #grok.template('paymentspage')
     
    422422    grok.context(IStudentAccommodation)
    423423    grok.name('index')
    424     grok.require('waeup.viewStudents')
     424    grok.require('waeup.viewStudent')
    425425    form_fields = grok.AutoFields(IStudentAccommodation)
    426426    #grok.template('accommodationpage')
     
    437437    grok.context(IStudent)
    438438    grok.name('history')
    439     grok.require('waeup.viewStudents')
     439    grok.require('waeup.viewStudent')
    440440    grok.template('studenthistory')
    441441    title = 'History'
  • main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py

    r6655 r6660  
    2121# Student section permissions
    2222
    23 class ViewStudents(grok.Permission):
    24     grok.name('waeup.viewStudents')
     23class HandleStudent(grok.Permission):
     24    grok.name('waeup.handleStudent')
     25
     26class ViewStudent(grok.Permission):
     27    grok.name('waeup.viewStudent')
    2528
    2629class ManageStudents(grok.Permission):
    2730    grok.name('waeup.manageStudents')
     31
     32# Local role
     33class StudentRecordOwner(grok.Role):
     34    grok.name('waeup.local.StudentRecordOwner')
     35    grok.title(u'Student Record Owner')
     36    grok.permissions('waeup.handleStudent', 'waeup.viewStudent')
    2837
    2938# Global Roles
     
    3241    grok.title(u'Students Officer')
    3342    grok.permissions('waeup.View', 'waeup.Public',
    34                      'waeup.viewStudents', 'waeup.manageStudents')
     43                     'waeup.viewStudent', 'waeup.manageStudents')
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r6642 r6660  
    99
    1010class StudentLink(grok.Viewlet):
    11     """A link displayed in the student box which shows for StudentNavigation
     11    """A link displayed in the student box which shows up for StudentNavigation
    1212    objects.
    1313
     
    1818    grok.view(Interface)
    1919    grok.order(5)
    20     grok.require('waeup.viewStudents')
     20    grok.require('waeup.viewStudent')
    2121
    2222    link = 'index'
Note: See TracChangeset for help on using the changeset viewer.