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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/exercise_service.py

  • Committer: William Grant
  • Date: 2009-08-12 04:30:38 UTC
  • Revision ID: grantw@unimelb.edu.au-20090812043038-pil4b76apx9rw86x
Allow tutors to add exercises.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
class ExercisesRESTView(JSONRESTView):
30
30
    """Rest view for adding an exercise."""
31
31
    
32
 
    #Only lecturers and admins can add exercises
 
32
    #Only lecturers, tutors and admins can add exercises
33
33
    def get_permissions(self, user):
34
34
        if user is not None:
35
35
            if user.admin:
36
36
                return set(['save'])
37
37
            elif 'lecturer' in set((e.role for e in user.active_enrolments)):
38
38
                return set(['save'])
 
39
            elif 'tutor' in set((e.role for e in user.active_enrolments)):
 
40
                return set(['save'])
39
41
            else:
40
42
                return set()
41
43
        else: