Changeset 6681 for main/waeup.sirp


Ignore:
Timestamp:
5 Sep 2011, 10:03:55 (13 years ago)
Author:
Henrik Bettermann
Message:

Assign local StudentRecordOwner? role when adding a student.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/container.py

    r6679 r6681  
    2020import os
    2121from zope.component.interfaces import IFactory
     22from zope.securitypolicy.interfaces import IPrincipalRoleManager
    2223from waeup.sirp.interfaces import IUserAccount
    2324from waeup.sirp.students.interfaces import (
     
    5556        accommodation = StudentAccommodation()
    5657        self[student.student_id]['accommodation'] = accommodation
    57         # assign student role for new student
     58        # Assign global student role for new student
    5859        account = IUserAccount(student)
    5960        account.roles = 'waeup.Student'
     61        # Assign local StudentRecordOwner role
     62        role_manager = IPrincipalRoleManager(self[student.student_id])
     63        role_manager.assignRoleToPrincipal(
     64            'waeup.local.StudentRecordOwner', student.student_id)
    6065        # Return student_id (only needed in tests)
    6166        return student.student_id
Note: See TracChangeset for help on using the changeset viewer.