Changeset 7178 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 23 Nov 2011, 09:32:17 (13 years ago)
- 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 42 42 grok.permissions('waeup.handleApplication', 'waeup.viewApplication') 43 43 44 # Globalrole44 # Site role 45 45 46 46 class ApplicantRole(grok.Role): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7162 r7178 139 139 >>> browser.getControl("Cancel", index=0).click() 140 140 141 We can add globalroles which are then displayed on the user container page.142 Since the test browser does not use javascript, we have to add globalroles141 We can add site roles which are then displayed on the user container page. 142 Since the test browser does not use javascript, we have to add site roles 143 143 manually by setting the roles attribute: 144 144 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7177 r7178 274 274 return local_roles_string 275 275 276 def get GlobalRoles(self, account):277 global_roles = account.roles278 global_roles_string = ''279 for global_role in global_roles:280 role_title = dict(getAllRoles())[ global_role].title281 global_roles_string += '%s <br />' % role_title282 return global_roles_string276 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 283 283 284 284 class AddUserFormPage(WAeUPAddFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/userscontainerpage.pt
r7176 r7178 11 11 <th>Name</th> 12 12 <th>Description</th> 13 <th> Global roles</th>14 <th>Local roles</th>13 <th>Portal Roles</th> 14 <th>Local Roles</th> 15 15 <th></th> 16 16 </tr> … … 21 21 <td tal:content="account/title">Title</td> 22 22 <td tal:content="account/description">Description</td> 23 <td tal:content="structure python:view.get GlobalRoles(account)">Global Roles</td>24 <td tal:content="structure python:view.getLocalRoles(account)">L ocal 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> 25 25 <td class="text-right"> 26 26 <form method="post"> -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/permissions.py
r7013 r7178 27 27 grok.name('waeup.manageHostels') 28 28 29 # GlobalRoles29 # Site Roles 30 30 class AccommodationOfficer(grok.Role): 31 31 grok.name('waeup.AccommodationOfficer') -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r7177 r7178 77 77 78 78 class RoleSource(BasicSourceFactory): 79 """A source for globalroles.79 """A source for site roles. 80 80 """ 81 81 def getValues(self): … … 189 189 required = False,) 190 190 roles = schema.List( 191 title = u' Global roles',191 title = u'Portal roles', 192 192 value_type = schema.Choice(source=RoleSource())) 193 193 -
main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
r7177 r7178 67 67 grok.permissions('waeup.editUser') 68 68 69 # GlobalRoles69 # Site Roles 70 70 class PortalUser(grok.Role): 71 71 grok.name('waeup.PortalUser') … … 119 119 """ 120 120 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].title130 # 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_string137 138 #def getGlobalRolesForAccount(account):139 # """Return HTML tagged string with all global roles of a user account.140 # """141 # global_roles = account.roles142 # global_roles_string = ''143 # for global_role in global_roles:144 # role_title = dict(getAllRoles())[global_role].title145 # global_roles_string += '%s <br />' % role_title146 # return global_roles_string147 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 return155 156 121 157 122 class LocalRolesAssignable(grok.Adapter): -
main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py
r7168 r7178 46 46 'waeup.viewStudent', 'waeup.payStudent') 47 47 48 # GlobalRoles48 # Site Roles 49 49 class StudentRole(grok.Role): 50 50 grok.name('waeup.Student')
Note: See TracChangeset for help on using the changeset viewer.