Changeset 13856 for main/kofacustom.nigeria
- Timestamp:
- 4 May 2016, 07:14:34 (9 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r13787 r13856 19 19 from zope.formlib.textwidgets import BytesDisplayWidget 20 20 from zope.component import getUtility 21 from zope.security import checkPermission 21 22 from zope.i18n import translate 22 23 from datetime import datetime … … 350 351 351 352 def _sigsInFooter(self): 352 353 isStudent = getattr( 354 self.request.principal, 'user_type', None) == 'student' 355 if isStudent: 353 if not checkPermission('waeup.clearStudentFinancially', self.context): 356 354 return () 357 355 return (_('Date, Checking Officer Signature'), -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/permissions.py
r13634 r13856 30 30 31 31 32 class BursaryOfficer(grok.Role): 33 """Financial Clearance Officers (aka Bursary Officers) 34 can export bursary data. They can't access the 35 Data Center but see student data export buttons in the Academic Section. 36 37 This role overwrites the same-named role in waeup.kofa. In 38 kofacustom.nigeria bursary officers are also allowed to clear 39 students financially. 32 class FinancialClearanceOfficer(grok.Role): 33 """Financial Clearance Officers are also allowed to clear 34 students financially. Usually this role is assigned together 35 with the BursaryOfficer role and the StudentsOfficer role. 40 36 """ 41 grok.name('waeup.BursaryOfficer') 42 grok.title(u'Bursary Officer') 43 grok.permissions('waeup.showStudents', 44 'waeup.viewAcademics', 45 'waeup.exportBursaryData', 46 'waeup.clearStudentFinancially') 37 grok.name('waeup.FinancialClearanceOfficer') 38 grok.title(u'Financial Clearance Officer') 39 grok.permissions('waeup.clearStudentFinancially') -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py
r13781 r13856 361 361 # Assign BursaryOfficer role 362 362 prmglobal.assignRoleToPrincipal('waeup.BursaryOfficer', 'mrbursary') 363 # and FinancialClearanceOfficer role 364 prmglobal.assignRoleToPrincipal( 365 'waeup.FinancialClearanceOfficer', 'mrbursary') 363 366 # Login 364 367 self.browser.open(self.login_path) … … 373 376 # BO can view student record 374 377 self.browser.open(self.student_path) 375 prmglobal.assignRoleToPrincipal('waeup.BursaryOfficer', 'mrbursary')376 self.browser.open(self.student_path)377 378 # BO can see clearance button ... 378 379 self.assertTrue( … … 420 421 self.browser.contents) 421 422 422 def test_ bursary_pdf_slip(self):423 def test_fiancial_clearance_pdf_slip(self): 423 424 payment1 = createObject(u'waeup.StudentOnlinePayment') 424 425 timestamp = ("%d" % int(time()*10000))[1:] -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py
r13781 r13856 38 38 return False 39 39 40 # Bursery officer buttons41 42 class Student ClearActionButton(ManageActionButton):40 # Financial Clearance Officer buttons 41 42 class StudentFinanciallyClearActionButton(ManageActionButton): 43 43 grok.order(10) 44 44 grok.context(INigeriaStudent) … … 55 55 return self.view.url(self.view.context, self.target) 56 56 57 class StudentWithdraw ClearanceActionButton(ManageActionButton):57 class StudentWithdrawFinancialClearanceActionButton(ManageActionButton): 58 58 grok.order(11) 59 59 grok.context(INigeriaStudent)
Note: See TracChangeset for help on using the changeset viewer.