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

« back to all changes in this revision

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

  • Committer: Matt Giuca
  • Date: 2010-02-12 04:00:39 UTC
  • Revision ID: matt.giuca@gmail.com-20100212040039-vw9yf8p4s98g6nu9
Added an argument 'config' to every single get_permissions method throughout the program. All calls to get_permissions pass a config. This is to allow per-site policy configurations on permissions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
        ctx['worksheetstream'] = genshi.Stream(list(genshi.XML(self.context.get_xml())))
87
87
        ctx['user'] = req.user
 
88
        ctx['config'] = req.config
88
89
 
89
90
        generate_worksheet_data(ctx, req, self.context)
90
91
 
527
528
    tab = 'subjects'
528
529
 
529
530
    def authorize(self, req):
530
 
        return 'edit' in ivle.database.Exercise.global_permissions(req.user)
 
531
        return ('edit' in
 
532
            ivle.database.Exercise.global_permissions(req.user, req.config))
531
533
 
532
534
    def populate(self, req, ctx):
533
535
        self.plugin_scripts[Plugin] = ['exercise_admin.js']
542
544
    tab = 'subjects'
543
545
 
544
546
    def authorize(self, req):
545
 
        return 'edit' in ivle.database.Exercise.global_permissions(req.user)
 
547
        return ('edit' in
 
548
            ivle.database.Exercise.global_permissions(req.user, req.config))
546
549
 
547
550
    def populate(self, req, ctx):
548
551
        self.plugin_styles[Plugin] = ['exercise_admin.css']