~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: Matt Giuca
  • Date: 2009-12-08 11:41:44 UTC
  • Revision ID: matt.giuca@gmail.com-20091208114144-bzi17mcl5o5ms65k
database: Added finer-grained enrol permissions on offerings.
    (Separate permissions for students, tutors and lecturers.)
Enrolment page: Added a drop-down box for selecting which role to enrol as.
    The role is checked against the user's permissions, to make sure they have
    the authority to assign such a role.

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
            if (enrolment and enrolment.role in (u'tutor', u'lecturer')) \
376
376
               or user.admin:
377
377
                perms.add('edit')
378
 
                # XXX Bug #493945 -- should tutors have this permission?
 
378
                # XXX Bug #493945 -- should tutors have these permissions?
379
379
                # Potentially move into the next category (lecturer & admin)
380
 
                perms.add('enrol')
 
380
                perms.add('enrol')          # Can see enrolment screen at all
 
381
                perms.add('enrol_student')  # Can enrol students
 
382
            if (enrolment and enrolment.role in (u'lecturer')) or user.admin:
 
383
                perms.add('enrol_tutor')    # Can enrol tutors
 
384
            if user.admin:
 
385
                perms.add('enrol_lecturer') # Can enrol lecturers
381
386
        return perms
382
387
 
383
388
    def get_enrolment(self, user):