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

« back to all changes in this revision

Viewing changes to ivle/webapp/base/views.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:
33
33
    def render(self, req):
34
34
        raise NotImplementedError()
35
35
 
36
 
    def get_permissions(self, user):
37
 
        return self.context.get_permissions(user)
 
36
    def get_permissions(self, user, config):
 
37
        return self.context.get_permissions(user, config)
38
38
 
39
39
    def authorize(self, req):
40
 
        self.perms = self.get_permissions(req.user)
 
40
        self.perms = self.get_permissions(req.user, req.config)
41
41
 
42
42
        return self.permission is None or self.permission in self.perms