Changeset 7178


Ignore:
Timestamp:
23 Nov 2011, 09:32:17 (13 years ago)
Author:
Henrik Bettermann
Message:

Let's be more precise: Global roles actually are site roles. Since the user does not understand the term 'site' we should use the term 'portal' in the UI instead. Now we have portal (site) roles, local roles and dynamic roles.

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

Legend:

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

    r7166 r7178  
    4242    grok.permissions('waeup.handleApplication', 'waeup.viewApplication')
    4343
    44 # Global role
     44# Site role
    4545
    4646class ApplicantRole(grok.Role):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r7162 r7178  
    139139  >>> browser.getControl("Cancel", index=0).click()
    140140
    141 We can add global roles which are then displayed on the user container page.
    142 Since the test browser does not use javascript, we have to add global roles
     141We can add site roles which are then displayed on the user container page.
     142Since the test browser does not use javascript, we have to add site roles
    143143manually by setting the roles attribute:
    144144
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7177 r7178  
    274274        return local_roles_string
    275275
    276     def getGlobalRoles(self, account):
    277         global_roles = account.roles
    278         global_roles_string = ''
    279         for global_role in global_roles:
    280             role_title = dict(getAllRoles())[global_role].title
    281             global_roles_string += '%s <br />' % role_title
    282         return global_roles_string
     276    def getSiteRoles(self, account):
     277        site_roles = account.roles
     278        site_roles_string = ''
     279        for site_role in site_roles:
     280            role_title = dict(getAllRoles())[site_role].title
     281            site_roles_string += '%s <br />' % role_title
     282        return site_roles_string
    283283
    284284class AddUserFormPage(WAeUPAddFormPage):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/userscontainerpage.pt

    r7176 r7178  
    1111      <th>Name</th>
    1212      <th>Description</th>
    13       <th>Global roles</th>
    14       <th>Local roles</th>
     13      <th>Portal Roles</th>
     14      <th>Local Roles</th>
    1515      <th></th>
    1616    </tr>
     
    2121      <td tal:content="account/title">Title</td>
    2222      <td tal:content="account/description">Description</td>
    23       <td tal:content="structure python:view.getGlobalRoles(account)">Global Roles</td>
    24       <td tal:content="structure python:view.getLocalRoles(account)">Local Roles</td>
     23      <td tal:content="structure python:view.getSiteRoles(account)">SITE ROLES</td>
     24      <td tal:content="structure python:view.getLocalRoles(account)">LOCAL ROLES</td>
    2525      <td class="text-right">
    2626        <form method="post">
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/permissions.py

    r7013 r7178  
    2727    grok.name('waeup.manageHostels')
    2828
    29 # Global Roles
     29# Site Roles
    3030class AccommodationOfficer(grok.Role):
    3131    grok.name('waeup.AccommodationOfficer')
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7177 r7178  
    7777
    7878class RoleSource(BasicSourceFactory):
    79     """A source for global roles.
     79    """A source for site roles.
    8080    """
    8181    def getValues(self):
     
    189189        required = False,)
    190190    roles = schema.List(
    191         title = u'Global roles',
     191        title = u'Portal roles',
    192192        value_type = schema.Choice(source=RoleSource()))
    193193
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.py

    r7177 r7178  
    6767    grok.permissions('waeup.editUser')
    6868
    69 # Global Roles
     69# Site Roles
    7070class PortalUser(grok.Role):
    7171    grok.name('waeup.PortalUser')
     
    119119    """
    120120    return sorted([x.id for x in getWAeUPRoles()])
    121 
    122 #def getLocalRolesForAccount(view, account):
    123 #    """Return HTML tagged string with all local roles of a user account.
    124 #    """
    125 #    local_roles = account.getLocalRoles()
    126 #    local_roles_string = ''
    127 #    site_url = view.url(grok.getSite())
    128 #    for local_role in local_roles.keys():
    129 #        role_title = dict(getAllRoles())[local_role].title
    130 #        objects_string = ''
    131 #        for object in local_roles[local_role]:
    132 #            objects_string += '<a href="%s">%s</a>, ' %(view.url(object),
    133 #                view.url(object).replace(site_url,''))
    134 #        local_roles_string += '%s: <br />%s <br />' %(role_title,
    135 #            objects_string.rstrip(', '))
    136 #    return local_roles_string
    137 
    138 #def getGlobalRolesForAccount(account):
    139 #    """Return HTML tagged string with all global roles of a user account.
    140 #    """
    141 #    global_roles = account.roles
    142 #    global_roles_string = ''
    143 #    for global_role in global_roles:
    144 #        role_title = dict(getAllRoles())[global_role].title
    145 #        global_roles_string += '%s <br />' % role_title
    146 #    return global_roles_string
    147 
    148 def getMyRoles(view):
    149     account = get_user_account(view.request)
    150     if account:
    151         global_roles = getGlobalRoles(account)
    152         local_roles = getLocalRoles(account)
    153         return [global_roles,local_roles]
    154     return
    155 
    156121
    157122class LocalRolesAssignable(grok.Adapter):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py

    r7168 r7178  
    4646                     'waeup.viewStudent', 'waeup.payStudent')
    4747
    48 # Global Roles
     48# Site Roles
    4949class StudentRole(grok.Role):
    5050    grok.name('waeup.Student')
Note: See TracChangeset for help on using the changeset viewer.