Changeset 9335
- Timestamp:
- 15 Oct 2012, 05:08:01 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/authentication.py
r7811 r9335 20 20 """ 21 21 import grok 22 from zope.component import getUtility 23 from zope.password.interfaces import IPasswordManager 22 24 from zope.pluggableauth.interfaces import IAuthenticatorPlugin 23 25 from waeup.kofa.interfaces import IAuthPluginUtility, IUserAccount … … 43 45 def user_type(self): 44 46 return u'applicant' 47 48 def checkPassword(self, password): 49 """Check whether the given `password` matches the one stored by 50 students. 51 52 We additionally check if student account has been suspended. 53 """ 54 if not isinstance(password, basestring): 55 return False 56 passwordmanager = getUtility(IPasswordManager, 'SSHA') 57 if not getattr(self.context, 'password', None): 58 # unset/empty passwords do never match 59 return False 60 if self.context.suspended == True: 61 return False 62 return passwordmanager.checkPassword(self.context.password, password) 45 63 46 64 class ApplicantsAuthenticatorPlugin(StudentsAuthenticatorPlugin): -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r9309 r9335 224 224 'waeup.handleAccommodation', 225 225 'waeup.viewHostels', 'waeup.manageHostels', 226 'waeup.editUser' 226 'waeup.editUser', 227 'waeup.loginAsStudent' 227 228 ) 228 229 … … 250 251 'waeup.handleAccommodation', 251 252 'waeup.viewHostels', 'waeup.manageHostels', 252 #'waeup.editUser' 253 #'waeup.editUser', 254 #'waeup.loginAsStudent' 253 255 ) 254 256 -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.txt
r9309 r9335 39 39 >>> from waeup.kofa.permissions import get_waeup_roles 40 40 >>> len(list(get_waeup_roles())) 41 1 741 18 42 42 43 43 >>> len(list(get_waeup_roles(also_local=True))) 44 3 144 32 45 45 46 46 … … 64 64 u'waeup.PortalManager', 65 65 u'waeup.Student', 66 u'waeup.StudentImpersonator', 66 67 u'waeup.StudentsClearanceOfficer', 67 68 u'waeup.StudentsCourseAdviser', -
main/waeup.kofa/trunk/src/waeup/kofa/students/permissions.py
r9273 r9335 59 59 grok.name('waeup.triggerTransition') 60 60 61 class LoginAsStudent(grok.Permission): 62 grok.name('waeup.loginAsStudent') 63 61 64 # Local role 62 65 class StudentRecordOwner(grok.Role): … … 96 99 grok.title(u'Course Adviser (all students)') 97 100 grok.permissions('waeup.validateStudent','waeup.viewStudent') 101 102 class StudentImpersonator(grok.Role): 103 grok.name('waeup.StudentImpersonator') 104 grok.title(u'Student Impersonator') 105 grok.permissions('waeup.loginAsStudent')
Note: See TracChangeset for help on using the changeset viewer.