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

« back to all changes in this revision

Viewing changes to ivle/webapp/media.py

  • Committer: William Grant
  • Date: 2010-02-11 08:36:15 UTC
  • Revision ID: grantw@unimelb.edu.au-20100211083615-5imzir7px5dblvwk
divify the login form, fixing up the submit/error indentation while there.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
                return None
71
71
 
72
72
            # Unless it's a whitelisted path, we don't want to hear about it.
73
 
            # If the whitelist is None (not []), we allow all.
74
 
            if extern[1] is not None and self.path not in extern[1]:
 
73
            if self.path not in extern[1]:
75
74
                return None
76
75
 
77
76
            # Grab the admin-configured path for this particular external dep.
95
94
            return os.path.join(plugindir, mediadir, self.path)
96
95
 
97
96
class MediaFileView(BaseView):
98
 
    def authorize(self, req):
99
 
        return True
 
97
    permission = None
100
98
 
101
99
    def render(self, req):
102
100
        # If it begins with ".." or separator, it's illegal. Die.
132
130
    def get_filename(self, req):
133
131
        return self.context.filename
134
132
 
 
133
    def get_permissions(self, user):
 
134
        return set()
 
135
 
135
136
def root_to_media(root, *segments):
136
137
    if segments[0].startswith('+'):
137
138
        if segments[0] == '+external':