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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-12-02 02:20:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20091202022057-m3w3rzrzp47y89to
Refuse to traverse through an object to which the user has no permissions. This stops information leakage in breadcrumbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        self.smap[segment] = viewset
141
141
        self.srmap[viewset] = segment
142
142
 
 
143
    def traversed_to_object(self, obj):
 
144
        """Called when the path resolver encounters an object.
 
145
 
 
146
        Can be overridden to perform checks on an object before
 
147
        continuing resolution. This is handy for verifying permissions.
 
148
        """
 
149
        # We do nothing by default.
 
150
        pass
 
151
 
143
152
    def resolve(self, path):
144
153
        """Resolve a path into an object.
145
154
 
320
329
                raise NotFound(obj, tuple(args) if len(args) != 1 else args[0],
321
330
                               tuple(todo))
322
331
 
 
332
            self.traversed_to_object(newobj)
 
333
 
323
334
            obj = newobj
324
335