Changeset 7185 for main/waeup.sirp/trunk


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

Rename roles:

Department Officers are now Department Managers and Portal Users are now called Academics Officers. Academics Officers only have the viewAcademics permission like applicants and students.

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

Legend:

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

    r7177 r7185  
    214214def handle_account_added(account, event):
    215215    """When an account is added, the local owner role and the global
    216     PortalUser role must be set.
     216    AcademicsOfficer role must be set.
    217217    """
    218218    # We set the local Owner role
     
    220220    role_manager_account.assignRoleToPrincipal(
    221221        'waeup.local.Owner', account.name)
    222     # We set the global PortalUser role
     222    # We set the global AcademicsOfficer role
    223223    site = grok.getSite()
    224224    role_manager_site = IPrincipalRoleManager(site)
    225225    role_manager_site.assignRoleToPrincipal(
    226         'waeup.PortalUser', account.name)
     226        'waeup.AcademicsOfficer', account.name)
    227227    # Finally we have to notify the user account that the local role
    228228    # of the same object has changed
  • main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt

    r7177 r7185  
    5151  {'waeup.local.Owner': [<waeup.sirp.authentication.Account object at 0x...>]}
    5252
    53 Users have also got the global PortalUser role:
     53Users have also got the global AcademicsOfficer role:
    5454
    5555  >>> alice.getSiteRolesForPrincipal()
    56   ['waeup.PortalUser']
     56  ['waeup.AcademicsOfficer']
    5757
    5858We can tell an account, that Alice got some role for another object:
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r7178 r7185  
    145145  >>> print root['myuniversity']['users']['bob'].roles
    146146  []
    147   >>> root['myuniversity']['users']['bob'].roles = ['waeup.PortalUser']
     147  >>> root['myuniversity']['users']['bob'].roles = ['waeup.ApplicationsOfficer']
    148148  >>> print root['myuniversity']['users']['bob'].roles
    149   ['waeup.PortalUser']
     149  ['waeup.ApplicationsOfficer']
    150150  >>> browser.open('http://localhost/myuniversity/users')
    151151  >>> print browser.contents
    152152  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    153   ...<td>Portal User <br /></td>
     153  ...<td>Applications Officer <br /></td>
    154154  ...
    155155
     
    303303  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
    304304  >>> browser.getControl(name="user").value = ['bob']
    305   >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentOfficer']
     305  >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentManager']
    306306  >>> browser.getControl("Add local role").click()
    307307  >>> print browser.contents
     
    315315  >>> print browser.contents
    316316  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    317   ...<td>Department Officer:...
     317  ...<td>Department Manager:...
    318318  ...
    319319
     
    330330  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
    331331  >>> ctrl = browser.getControl(name='role_id')
    332   >>> ctrl.getControl(value='bob|waeup.local.DepartmentOfficer').selected = True
     332  >>> ctrl.getControl(value='bob|waeup.local.DepartmentManager').selected = True
    333333  >>> browser.getControl("Remove selected local roles").click()
    334334  >>> print browser.contents
     
    459459  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage')
    460460  >>> browser.getControl(name="user").value = ['bob']
    461   >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentOfficer']
     461  >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentManager']
    462462  >>> browser.getControl("Add local role").click()
    463463  >>> print browser.contents
     
    478478  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage')
    479479  >>> ctrl = browser.getControl(name='role_id')
    480   >>> ctrl.getControl(value='bob|waeup.local.DepartmentOfficer').selected = True
     480  >>> ctrl.getControl(value='bob|waeup.local.DepartmentManager').selected = True
    481481  >>> browser.getControl("Remove selected local roles").click()
    482482  >>> print browser.contents
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.py

    r7184 r7185  
    5050
    5151# Local Roles
    52 class DepartmentOfficer(grok.Role):
    53     grok.name('waeup.local.DepartmentOfficer')
    54     grok.title(u'Department Officer')
     52class DepartmentManager(grok.Role):
     53    grok.name('waeup.local.DepartmentManager')
     54    grok.title(u'Department Manager')
    5555    grok.permissions('waeup.manageUniversity')
    5656
     
    7575
    7676# Site Roles
    77 class PortalUser(grok.Role):
    78     grok.name('waeup.PortalUser')
    79     grok.title(u'Portal User')
     77class AcademicsOfficer(grok.Role):
     78    grok.name('waeup.AcademicsOfficer')
     79    grok.title(u'Academics Offiver (view only)')
    8080    grok.permissions('waeup.viewAcademics')
    8181
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt

    r7181 r7185  
    5353    >>> from waeup.sirp.permissions import getWAeUPRoleNames
    5454    >>> list(getWAeUPRoleNames())
    55     [u'waeup.ACManager', u'waeup.AccommodationOfficer', u'waeup.Applicant',
     55    [u'waeup.ACManager', u'waeup.AcademicsOfficer',
     56     u'waeup.AccommodationOfficer', u'waeup.Applicant',
    5657     u'waeup.ApplicationsOfficer',
    57      u'waeup.PortalManager', u'waeup.PortalUser', u'waeup.Student',
     58     u'waeup.PortalManager', u'waeup.Student',
    5859     u'waeup.StudentsClearanceOfficer', u'waeup.StudentsManager',
    5960     u'waeup.StudentsOfficer']
  • main/waeup.sirp/trunk/src/waeup/sirp/university/department.py

    r7137 r7185  
    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.DepartmentManager',
    1818                'waeup.local.ClearanceOfficer',]
    1919
  • main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py

    r7153 r7185  
    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.DepartmentManager',
    1919                'waeup.local.ClearanceOfficer',]
    2020
Note: See TracChangeset for help on using the changeset viewer.