Changeset 10541 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 27 Aug 2013, 20:32:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r10540 r10541 234 234 return entries 235 235 236 class LocalRoleAssignmentUtilityView(object): 237 """A view mixin with useful methods for local role assignment. 238 239 """ 240 241 def getLocalRoles(self): 242 roles = ILocalRolesAssignable(self.context) 243 return roles() 244 245 def getUsers(self): 246 return get_all_users() 247 248 def getUsersWithLocalRoles(self): 249 return get_users_with_local_roles(self.context) 250 236 251 # 237 252 # Login/logout and language switch pages... … … 1773 1788 return _('Departments') 1774 1789 1775 class FacultyManageFormPage(KofaEditFormPage): 1790 class FacultyManageFormPage(KofaEditFormPage, 1791 LocalRoleAssignmentUtilityView): 1776 1792 """Manage the basic properties of a `Faculty` instance. 1777 1793 """ … … 1804 1820 return super(FacultyManageFormPage, self).update() 1805 1821 1806 def getLocalRoles(self):1807 roles = ILocalRolesAssignable(self.context)1808 return roles()1809 1810 def getUsers(self):1811 return get_all_users()1812 1813 def getUsersWithLocalRoles(self):1814 return get_users_with_local_roles(self.context)1815 1816 1822 @jsaction(_('Remove selected')) 1817 1823 def delDepartments(self, **data): … … 1908 1914 yield(dict(url=url, name=key, container=val)) 1909 1915 1910 class DepartmentManageFormPage(KofaEditFormPage): 1916 class DepartmentManageFormPage(KofaEditFormPage, 1917 LocalRoleAssignmentUtilityView): 1911 1918 """Manage the basic properties of a `Department` instance. 1912 1919 """ … … 1954 1961 super(DepartmentManageFormPage, self).update() 1955 1962 return 1956 1957 def getLocalRoles(self):1958 roles = ILocalRolesAssignable(self.context)1959 return roles()1960 1961 def getUsers(self):1962 return get_all_users()1963 1964 def getUsersWithLocalRoles(self):1965 return get_users_with_local_roles(self.context)1966 1963 1967 1964 @action(_('Save'), style='primary') … … 2105 2102 return '%s (%s)' % (self.context.title, self.context.code) 2106 2103 2107 class CourseManageFormPage(KofaEditFormPage): 2104 class CourseManageFormPage(KofaEditFormPage, 2105 LocalRoleAssignmentUtilityView): 2108 2106 """Edit form page for courses. 2109 2107 """ … … 2140 2138 return 2141 2139 2142 def getLocalRoles(self):2143 roles = ILocalRolesAssignable(self.context)2144 return roles()2145 2146 def getUsers(self):2147 return get_all_users()2148 2149 def getUsersWithLocalRoles(self):2150 return get_users_with_local_roles(self.context)2151 2152 2140 @action(_('Add local role'), validator=NullValidator) 2153 2141 def addLocalRole(self, **data): … … 2179 2167 return super(CertificatePage, self).update() 2180 2168 2181 class CertificateManageFormPage(KofaEditFormPage): 2169 class CertificateManageFormPage(KofaEditFormPage, 2170 LocalRoleAssignmentUtilityView): 2182 2171 """Manage the properties of a `Certificate` instance. 2183 2172 """ … … 2231 2220 self.redirect(self.url(self.context)) 2232 2221 return 2233 2234 def getLocalRoles(self):2235 roles = ILocalRolesAssignable(self.context)2236 return roles()2237 2238 def getUsers(self):2239 return get_all_users()2240 2241 def getUsersWithLocalRoles(self):2242 return get_users_with_local_roles(self.context)2243 2222 2244 2223 @action(_('Add local role'), validator=NullValidator)
Note: See TracChangeset for help on using the changeset viewer.