Ignore:
Timestamp:
4 May 2016, 07:14:34 (8 years ago)
Author:
Henrik Bettermann
Message:

Add FinancialClearanceOfficer? role. Only Financial Clearance Officers are allowed to print slips with signature fields.

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  
    1919from zope.formlib.textwidgets import BytesDisplayWidget
    2020from zope.component import getUtility
     21from zope.security import checkPermission
    2122from zope.i18n import translate
    2223from datetime import datetime
     
    350351
    351352    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):
    356354            return ()
    357355        return (_('Date, Checking Officer Signature'),
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/permissions.py

    r13634 r13856  
    3030
    3131
    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.
     32class 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.
    4036    """
    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  
    361361        # Assign BursaryOfficer role
    362362        prmglobal.assignRoleToPrincipal('waeup.BursaryOfficer', 'mrbursary')
     363        # and FinancialClearanceOfficer role
     364        prmglobal.assignRoleToPrincipal(
     365            'waeup.FinancialClearanceOfficer', 'mrbursary')
    363366        # Login
    364367        self.browser.open(self.login_path)
     
    373376        # BO can view student record
    374377        self.browser.open(self.student_path)
    375         prmglobal.assignRoleToPrincipal('waeup.BursaryOfficer', 'mrbursary')
    376         self.browser.open(self.student_path)
    377378        # BO can see clearance button ...
    378379        self.assertTrue(
     
    420421            self.browser.contents)
    421422
    422     def test_bursary_pdf_slip(self):
     423    def test_fiancial_clearance_pdf_slip(self):
    423424        payment1 = createObject(u'waeup.StudentOnlinePayment')
    424425        timestamp = ("%d" % int(time()*10000))[1:]
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py

    r13781 r13856  
    3838    return False
    3939
    40 # Bursery officer buttons
    41 
    42 class StudentClearActionButton(ManageActionButton):
     40# Financial Clearance Officer buttons
     41
     42class StudentFinanciallyClearActionButton(ManageActionButton):
    4343    grok.order(10)
    4444    grok.context(INigeriaStudent)
     
    5555        return self.view.url(self.view.context, self.target)
    5656
    57 class StudentWithdrawClearanceActionButton(ManageActionButton):
     57class StudentWithdrawFinancialClearanceActionButton(ManageActionButton):
    5858    grok.order(11)
    5959    grok.context(INigeriaStudent)
Note: See TracChangeset for help on using the changeset viewer.