Changeset 1179


Ignore:
Timestamp:
Nov 16, 2008, 2:21:54 AM (10 years ago)
Author:
Daniel Kahn Gillmor
Message:

public_tags_policy plugin: enable anonymous users to view attachments associated with public wiki pages as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tracplugins/publictags/public_tags_policy.py

    r1136 r1179  
    6161        self.env.log.debug("public_tags checking tags for " + self.view + " on " + "x")
    6262        if resource: # fine-grained permission check
     63            self.env.log.debug("Realm: " + resource.realm)
     64            # if it is an attachment, and it is a specific one, and we are trying to view a wiki page
     65            # then we will just test the permissions on the parent resource itself.
     66            if resource.realm == 'attachment' and resource.id and action == 'WIKI_VIEW':
     67                resource = resource.parent
     68
    6369            if resource.realm == 'wiki': # wiki realm or resource
    6470                if resource.id: # ... it's a resource
Note: See TracChangeset for help on using the changeset viewer.