~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-25 06:52:48 UTC
  • mto: This revision was merged to the branch mainline in revision 1731.
  • Revision ID: matt.giuca@gmail.com-20100225065248-p1t8oys3olxtwdlg
project-form no longer assumes the type of context; pass an extra projectset value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    """
24
24
 
25
25
    subpath_allowed = False
 
26
    offsite_posts_allowed = False
26
27
 
27
28
    def __init__(self, req, context, subpath=None):
 
29
        self.req = req
28
30
        self.context = context
29
31
        if self.subpath_allowed:
30
32
            self.subpath = subpath
32
34
    def render(self, req):
33
35
        raise NotImplementedError()
34
36
 
35
 
    def get_permissions(self, user):
36
 
        return self.context.get_permissions(user)
 
37
    def get_permissions(self, user, config):
 
38
        return self.context.get_permissions(user, config)
37
39
 
38
40
    def authorize(self, req):
39
 
        self.perms = self.get_permissions(req.user)
 
41
        self.perms = self.get_permissions(req.user, req.config)
40
42
 
41
43
        return self.permission is None or self.permission in self.perms