Ignore:
Timestamp:
6 May 2012, 11:19:38 (13 years ago)
Author:
Henrik Bettermann
Message:

Add more roles and reorganize permissions.

Remove grok.require('waeup.manageUniversity') from grok.Container classes.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/permissions.py

    r7250 r8367  
    4646    grok.title(u'Application Owner')
    4747    grok.permissions('waeup.handleApplication', 'waeup.viewApplication',
    48                      'waeup.Authenticated', 'waeup.payApplicant')
     48                     'waeup.payApplicant')
    4949
    5050# Site role
     
    5252class ApplicantRole(grok.Role):
    5353    grok.name('waeup.Applicant')
    54     grok.permissions('waeup.viewAcademics', 'waeup.viewMyApplicationDataTab')
     54    grok.permissions('waeup.viewAcademics', 'waeup.viewMyApplicationDataTab',
     55                     'waeup.Authenticated')
    5556
    5657class ApplicationsOfficer(grok.Role):
    5758    grok.name('waeup.ApplicationsOfficer')
    5859    grok.title(u'Applications Officer')
    59     grok.permissions('waeup.manageApplication', 'waeup.viewApplication'
     60    grok.permissions('waeup.manageApplication', 'waeup.viewApplication',
    6061                     'waeup.viewApplicantsTab', 'waeup.payApplicant')
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r8366 r8367  
    311311    grok.name('administration')
    312312    grok.context(IUniversity)
    313     grok.require('waeup.manageUniversity')
     313    grok.require('waeup.managePortal')
    314314    label = _(u'Administration')
    315315    pnav = 0
     
    356356    grok.context(IUniversity)
    357357    grok.name('reindex')
    358     grok.require('waeup.manageUniversity')
     358    grok.require('waeup.managePortal')
    359359
    360360    def update(self,ctlg=None):
     
    594594    grok.name('search')
    595595    grok.template('searchpage')
    596     grok.require('waeup.manageUniversity')
     596    grok.require('waeup.viewAcademics')
    597597    label = _(u"Search Academic Section")
    598598    pnav = 1
     
    863863    grok.name('import1')
    864864    grok.template('datacenterimport1page')
    865     grok.require('waeup.manageDataCenter')
     865    grok.require('waeup.importData')
    866866    label = _(u'Process CSV file')
    867867    pnav = 0
     
    893893    grok.name('import2')
    894894    grok.template('datacenterimport2page')
    895     grok.require('waeup.manageDataCenter')
     895    grok.require('waeup.importData')
    896896    label = _(u'Process CSV file')
    897897    pnav = 0
     
    10131013    grok.name('import3')
    10141014    grok.template('datacenterimport3page')
    1015     grok.require('waeup.manageDataCenter')
     1015    grok.require('waeup.importData')
    10161016    label = _(u'Process CSV file')
    10171017    pnav = 0
     
    11211121    grok.name('import4')
    11221122    grok.template('datacenterimport4page')
    1123     grok.require('waeup.manageDataCenter')
     1123    grok.require('waeup.importData')
    11241124    label = _(u'Process CSV file')
    11251125    pnav = 0
     
    11781178    grok.name('logs')
    11791179    grok.template('datacenterlogspage')
    1180     grok.require('waeup.manageUniversity')
     1180    grok.require('waeup.manageDataCenter')
    11811181    label = _(u'Show logfiles')
    11821182    pnav = 0
     
    12001200    grok.name('show')
    12011201    grok.template('datacenterlogsshowfilepage')
    1202     grok.require('waeup.manageUniversity')
     1202    grok.require('waeup.manageDataCenter')
    12031203    title = _(u'Data Center')
    12041204    pnav = 0
     
    12751275    grok.name('export')
    12761276    grok.template('datacenterexportpage')
    1277     grok.require('waeup.manageUniversity')
     1277    grok.require('waeup.manageDataCenter')
    12781278    label = _('Download portal data as CSV file')
    12791279    pnav = 0
     
    13021302    grok.context(IDataCenter)
    13031303    grok.name('export.csv')
    1304     grok.require('waeup.manageUniversity')
     1304    grok.require('waeup.manageDataCenter')
    13051305
    13061306    def render(self, exporter=None):
     
    13181318    """
    13191319    grok.name('export.xml')
    1320     grok.require('waeup.manageUniversity')
     1320    grok.require('waeup.managePortal')
    13211321
    13221322    def render(self):
     
    13351335    """
    13361336    grok.name('importxml')
    1337     grok.require('waeup.manageUniversity')
     1337    grok.require('waeup.managePortal')
    13381338
    13391339    def update(self, xmlfile=None, CANCEL=None, SUBMIT=None):
     
    13781378    grok.context(IFacultiesContainer)
    13791379    grok.name('manage')
    1380     grok.require('waeup.manageUniversity')
     1380    grok.require('waeup.manageAcademics')
    13811381    grok.template('facultiescontainermanagepage')
    13821382    pnav = 1
     
    14121412    """
    14131413    grok.context(IFacultiesContainer)
    1414     grok.require('waeup.manageUniversity')
     1414    grok.require('waeup.manageAcademics')
    14151415    grok.name('add')
    14161416    label = _('Add faculty')
     
    14531453    grok.context(IFaculty)
    14541454    grok.name('manage')
    1455     grok.require('waeup.manageUniversity')
     1455    grok.require('waeup.manageAcademics')
    14561456    grok.template('facultymanagepage')
    14571457    pnav = 1
     
    15271527    grok.context(IFaculty)
    15281528    grok.name('add')
    1529     grok.require('waeup.manageUniversity')
     1529    grok.require('waeup.manageAcademics')
    15301530    label = _('Add department')
    15311531    form_fields = grok.AutoFields(IDepartmentAdd)
     
    16211621    grok.context(IDepartment)
    16221622    grok.name('manage')
    1623     grok.require('waeup.manageUniversity')
     1623    grok.require('waeup.manageAcademics')
    16241624    pnav = 1
    16251625    grok.template('departmentmanagepage')
     
    17231723    grok.context(IDepartment)
    17241724    grok.name('addcourse')
    1725     grok.require('waeup.manageUniversity')
     1725    grok.require('waeup.manageAcademics')
    17261726    label = _(u'Add course')
    17271727    form_fields = grok.AutoFields(ICourseAdd)
     
    17601760    grok.context(IDepartment)
    17611761    grok.name('addcertificate')
    1762     grok.require('waeup.manageUniversity')
     1762    grok.require('waeup.manageAcademics')
    17631763    label = _(u'Add certificate')
    17641764    form_fields = grok.AutoFields(ICertificateAdd)
     
    18141814    grok.context(ICourse)
    18151815    grok.name('manage')
    1816     grok.require('waeup.manageUniversity')
     1816    grok.require('waeup.manageAcademics')
    18171817    label = _(u'Edit course')
    18181818    pnav = 1
     
    18631863    grok.context(ICertificate)
    18641864    grok.name('manage')
    1865     grok.require('waeup.manageUniversity')
     1865    grok.require('waeup.manageAcademics')
    18661866    pnav = 1
    18671867    label = _('Edit certificate')
     
    19411941    grok.context(ICertificate)
    19421942    grok.name('addcertificatecourse')
    1943     grok.require('waeup.manageUniversity')
     1943    grok.require('waeup.manageAcademics')
    19441944    form_fields = grok.AutoFields(ICertificateCourseAdd)
    19451945    pnav = 1
     
    19901990    grok.context(ICertificateCourse)
    19911991    grok.name('manage')
    1992     grok.require('waeup.manageUniversity')
     1992    grok.require('waeup.manageAcademics')
    19931993    form_fields = grok.AutoFields(ICertificateCourse)
    19941994    label = _('Edit course referrer')
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r8197 r8367  
    155155    grok.baseclass()
    156156    grok.order(2)
    157     grok.require('waeup.manageUniversity')
     157    grok.require('waeup.manageAcademics')
    158158    icon = 'actionicon_modify.png'
    159159    target = '@@manage'
     
    165165    grok.baseclass()
    166166    grok.order(4)
    167     grok.require('waeup.manageUniversity')
     167    grok.require('waeup.manageAcademics')
    168168    icon = 'actionicon_add.png'
    169169    target = 'add'
     
    175175    grok.baseclass()
    176176    grok.order(4)
    177     grok.require('waeup.manageUniversity')
     177    grok.require('waeup.manageAcademics')
    178178    icon = 'actionicon_delete.png'
    179179    target = 'remove'
     
    185185    grok.baseclass()
    186186    grok.order(5)
    187     grok.require('waeup.manageUniversity')
     187    grok.require('waeup.manageAcademics')
    188188    icon = 'actionicon_search.png'
    189189    target = 'search'
     
    236236#     #grok.view(Index)
    237237#     grok.order(98)
    238 #     grok.require('waeup.manageUniversity')
     238#     grok.require('waeup.managePortal')
    239239
    240240#class ImportXMLAction(grok.Viewlet):
     
    242242#    #grok.view(Index)
    243243#    grok.order(99)
    244 #    grok.require('waeup.manageUniversity')
     244#    grok.require('waeup.managePortal')
    245245#
    246246#    def update(self):
     
    259259    grok.context(IKofaObject)
    260260    grok.order(5)
    261     grok.require('waeup.manageUniversity')
     261    grok.require('waeup.manageAcademics')
    262262    icon = 'actionicon_modify.png' # File must exist in static/
    263263    title = 'Text of link'
     
    346346    every page the user is allowed to go to, if the user has also the
    347347    permissions set by `grok.require()`. By default only users with
    348     ``waeup.manageUniversity`` permission will see links defined by
     348    ``waeup.manageAcademics`` permission will see links defined by
    349349    this or derivated classes.
    350350    """
     
    523523    grok.template('actionbutton')
    524524    grok.viewletmanager(ActionBar)
    525     grok.require('waeup.manageUniversity')
     525    grok.require('waeup.manageAcademics')
    526526    icon = 'actionicon_manage.png' # File must exist in static/
    527527    target = '@@show' # link to this viewname.
     
    542542    grok.context(IDataCenter)
    543543    grok.view(DatacenterPage)
    544     grok.require('waeup.manageUniversity')
     544    grok.require('waeup.importData')
    545545    grok.order(6)
    546546    icon = 'actionicon_gear.png'
     
    551551    grok.context(IDataCenter)
    552552    grok.view(DatacenterPage)
    553     grok.require('waeup.manageUniversity')
     553    grok.require('waeup.manageDataCenter')
    554554    grok.order(5)
    555555    icon = 'actionicon_up.png'
     
    560560    grok.context(IDataCenter)
    561561    grok.view(DatacenterPage)
    562     grok.require('waeup.manageUniversity')
     562    grok.require('waeup.manageDataCenter')
    563563    grok.order(7)
    564564    icon = 'actionicon_down.png'
     
    657657    grok.order(1)
    658658    grok.viewletmanager(AdministrationTasks)
    659     grok.require('waeup.manageUniversity')
     659    grok.require('waeup.managePortal')
    660660    grok.template('admintask')
    661661
     
    765765    grok.viewletmanager(SubobjectLister)
    766766    grok.context(IFaculty)
    767     grok.require('waeup.manageUniversity')
     767    grok.require('waeup.manageAcademics')
    768768
    769769    def render(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/frontpage.html

    r8363 r8367  
    1 <h1>Welcome to WAeUP.Kofa,
     1<h1>Welcome to WAeUP.Kofa
    22<br>
    33<small>
  • main/waeup.kofa/trunk/src/waeup/kofa/permissions.py

    r8068 r8367  
    4747    grok.name('waeup.viewAcademics')
    4848
    49 class ManageUniversity(grok.Permission):
    50     grok.name('waeup.manageUniversity')
     49class ManageAcademicsPermission(grok.Permission):
     50    grok.name('waeup.manageAcademics')
     51
     52class ManagePortal(grok.Permission):
     53    grok.name('waeup.managePortal')
    5154
    5255class ManageUsers(grok.Permission):
     
    6164class ManageDataCenter(grok.Permission):
    6265    grok.name('waeup.manageDataCenter')
     66
     67class ImportData(grok.Permission):
     68    grok.name('waeup.importData')
    6369
    6470class ManagePortalConfiguration(grok.Permission):
     
    7278    grok.name('waeup.local.DepartmentManager')
    7379    grok.title(u'Department Manager')
    74     grok.permissions('waeup.manageUniversity','waeup.showStudents')
     80    grok.permissions('waeup.manageAcademics','waeup.showStudents')
    7581
    7682class ClearanceOfficer(grok.Role):
     
    141147    grok.permissions('waeup.viewAcademics')
    142148
     149class AcademicsManager(grok.Role):
     150    grok.name('waeup.AcademicsManager')
     151    grok.title(u'Academics Manager')
     152    grok.permissions('waeup.viewAcademics',
     153                     'waeup.manageAcademics')
     154
    143155class ACManager(grok.Role):
    144156    grok.name('waeup.ACManager')
     
    146158    grok.permissions('waeup.manageACBatches')
    147159
     160class DataCenterManager(grok.Role):
     161    grok.name('waeup.DataCenterManager')
     162    grok.title(u'Datacenter Manager')
     163    grok.permissions('waeup.manageDataCenter')
     164
     165class ImportManager(grok.Role):
     166    grok.name('waeup.ImportManager')
     167    grok.title(u'Import Manager')
     168    grok.permissions('waeup.manageDataCenter',
     169                     'waeup.importData')
     170
     171class UsersManager(grok.Role):
     172    grok.name('waeup.UsersManager')
     173    grok.title(u'Users Manager')
     174    grok.permissions('waeup.manageUsers')
     175
    148176class PortalManager(grok.Role):
    149177    grok.name('waeup.PortalManager')
    150178    grok.title(u'Portal Manager')
    151     grok.permissions('waeup.manageUniversity', 'waeup.manageUsers',
    152                      'waeup.viewAcademics', 'waeup.manageACBatches',
     179    grok.permissions('waeup.managePortal', 'waeup.manageUsers',
     180                     'waeup.viewAcademics', 'manageAcademics',
     181                     'waeup.manageACBatches',
    153182                     'waeup.manageDataCenter','waeup.managePortalSettings',
     183                     'waeup.importData',
    154184                     'waeup.managePortalConfiguration', 'waeup.viewApplication',
    155185                     'waeup.manageApplication', 'waeup.handleApplication',
  • main/waeup.kofa/trunk/src/waeup/kofa/permissions.txt

    r7819 r8367  
    3939    >>> from waeup.kofa.permissions import get_waeup_roles
    4040    >>> len(list(get_waeup_roles()))
    41     11
     41    15
    4242
    4343    >>> len(list(get_waeup_roles(also_local=True)))
    44     22
     44    26
    4545
    4646
     
    5454    >>> list(get_waeup_role_names())
    5555    [u'waeup.ACManager',
     56     u'waeup.AcademicsManager',
    5657     u'waeup.AcademicsOfficer',
    5758     u'waeup.AccommodationOfficer',
    5859     u'waeup.Applicant',
    5960     u'waeup.ApplicationsOfficer',
     61     u'waeup.DataCenterManager',
     62     u'waeup.ImportManager',
    6063     u'waeup.PortalManager',
    6164     u'waeup.Student',
     
    6366     u'waeup.StudentsCourseAdviser',
    6467     u'waeup.StudentsManager',
    65      u'waeup.StudentsOfficer']
     68     u'waeup.StudentsOfficer',
     69     u'waeup.UsersManager']
    6670
    6771:func:`get_users_with_local_roles`
  • main/waeup.kofa/trunk/src/waeup/kofa/students/permissions.py

    r7334 r8367  
    6262    grok.permissions('waeup.handleStudent', 'waeup.uploadStudentFile',
    6363                     'waeup.viewStudent', 'waeup.payStudent',
    64                      'waeup.handleAccommodation', 'waeup.Authenticated')
     64                     'waeup.handleAccommodation')
    6565
    6666# Site Roles
    6767class StudentRole(grok.Role):
    6868    grok.name('waeup.Student')
    69     grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab')
     69    grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab',
     70                     'waeup.Authenticated')
    7071
    7172class StudentsOfficer(grok.Role):
     
    7879    grok.name('waeup.StudentsManager')
    7980    grok.title(u'Students Manager')
    80     grok.permissions('waeup.viewStudent', 'waeup.manageStudent',
     81    grok.permissions('waeup.viewStudent', 'waeup.viewStudents',
     82                     'waeup.manageStudent', 'waeup.viewStudentsContainer',
    8183                     'waeup.payStudent', 'waeup.uploadStudentFile',
    82                      'waeup.handleAccommodation', 'waeup.viewStudents')
     84                     'waeup.viewStudentsTab', 'waeup.handleAccommodation')
    8385
    8486class StudentsClearanceOfficer(grok.Role):
  • main/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.py

    r7811 r8367  
    4646    """
    4747    grok.implements(ICertificatesContainer)
    48     grok.require('waeup.manageUniversity')
    4948
    5049    def __setitem__(self, name, certificate):
  • main/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.txt

    r7819 r8367  
    2121
    2222   .. attribute:: grok.implements(ICertificatesContainer)
    23 
    24    .. attribute:: grok.require('waeup.manageUniversity')
    2523
    2624   :class:`CertificatesContainer` instances are instances of
  • main/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.py

    r7811 r8367  
    3030    """
    3131    grok.implements(ICoursesContainer)
    32     grok.require('waeup.manageUniversity')
    3332
    3433    def __setitem__(self, name, course):
  • main/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.txt

    r7819 r8367  
    2121
    2222   .. attribute:: grok.implements(ICoursesContainer)
    23 
    24    .. attribute:: grok.require('waeup.manageUniversity')
    2523
    2624   :class:`CoursesContainer` instances are instances of
  • main/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.py

    r7819 r8367  
    2626    """
    2727    grok.implements(IFacultiesContainer)
    28     grok.require('waeup.manageUniversity')
    2928
    3029    def addFaculty(self, faculty):
Note: See TracChangeset for help on using the changeset viewer.