Ignore:
Timestamp:
30 Aug 2011, 05:43:06 (13 years ago)
Author:
Henrik Bettermann
Message:

The student section gets its own permissions module. Define new local and global roles (Students Officer, Clearance Officer & Course Adviser).

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
1 added
5 edited

Legend:

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

    r6201 r6655  
    7878    def update(self):
    7979        try:
    80             self.context = self.context.getObject()
     80            self.context = self.context = grok.getSite()
    8181        except:
    8282            pass
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.py

    r6622 r6655  
    3737    grok.name('waeup.managePortalSettings')
    3838
    39 class ViewStudents(grok.Permission):
    40     grok.name('waeup.viewStudents')
    41 
    42 class ManageStudents(grok.Permission):
    43     grok.name('waeup.manageStudents')
    44 
    4539# Local Roles
    4640class DepartmentOfficer(grok.Role):
     
    4842    grok.title(u'Department Officer')
    4943    grok.permissions('waeup.manageUniversity','waeup.View', 'waeup.Public')
     44
     45class ClearanceOfficer(grok.Role):
     46    grok.name('waeup.local.ClearanceOfficer')
     47    grok.title(u'Clearance Officer')
     48    # to be further defined
     49    grok.permissions('waeup.View', 'waeup.Public')
     50
     51class CourseAdviser(grok.Role):
     52    grok.name('waeup.local.CourseAdviser')
     53    grok.title(u'Course Adviser')
     54    # to be further defined
     55    grok.permissions('waeup.View', 'waeup.Public')
    5056
    5157# Global Roles
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt

    r6333 r6655  
    3939    >>> from waeup.sirp.permissions import getWAeUPRoles
    4040    >>> len(list(getWAeUPRoles()))
    41     3
     41    4
    4242
    4343    >>> len(list(getWAeUPRoles(also_local=True)))
    44     5
     44    8
    4545
    4646
     
    5353    >>> from waeup.sirp.permissions import getWAeUPRoleNames
    5454    >>> list(getWAeUPRoleNames())
    55     [u'waeup.ApplicationsOfficer', u'waeup.PortalManager', u'waeup.PortalUser']
     55    [u'waeup.ApplicationsOfficer', u'waeup.PortalManager', u'waeup.PortalUser', u'waeup.StudentsOfficer']
    5656
    5757:func:`get_users_with_local_roles`
  • main/waeup.sirp/trunk/src/waeup/sirp/university/department.py

    r6162 r6655  
    1515    @property       # Make this method read_only and looking like an attr.
    1616    def local_roles(cls):
    17         return ['waeup.local.DepartmentOfficer']
     17        return ['waeup.local.DepartmentOfficer', 'waeup.local.ClearanceOfficer']
    1818
    1919    # A simple counter for ids.
  • main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py

    r6162 r6655  
    1616    @property       # Make this method read_only and looking like an attr.
    1717    def local_roles(cls):
    18         return ['waeup.local.DepartmentOfficer']
     18        return ['waeup.local.DepartmentOfficer', 'waeup.local.ClearanceOfficer']
    1919
    2020    def __init__(self,
Note: See TracChangeset for help on using the changeset viewer.