Edgewall Software

Opened 11 years ago

Last modified 10 years ago

#10961 closed defect

Version control folder permissions — at Version 5

Reported by: chamith.malinda@… Owned by:
Priority: normal Milestone: 1.0.2
Component: version control/browser Version: 0.12
Severity: normal Keywords: authzpolicy
Cc: dev@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Hi,

I want to restrict several folders to several trac users. So I used FineGrainedPermissions.

If we say john not allowed to view the trunk/src/some/location then I put below in the /var/www/trac/conf/authzpolicy.conf file.

[repository:test_repo@*/source:trunk/src/some/location/*@*]
john = !BROWSER_VIEW, !FILE_VIEW

But it not getting effected. (I already give the permissions to group which the john also in for BROWSER_VIEW and FILE_VIEW in admin panel permissions) I need restrict the trunk/src/some/location folder only to john.

Change History (5)

comment:1 by Remy Blank, 11 years ago

You should use AuthzSourcePolicy for controlling access to repositories, not AuthzPolicy.

comment:2 by Christian Boos, 11 years ago

Keywords: authzpolicy verify added
Milestone: next-stable-1.0.x

Theoretically AuthzPolicy should be able to handle this as well…

comment:3 by Christian Boos, 11 years ago

Description: modified (diff)

comment:4 by theYT <dev@…>, 10 years ago

Cc: dev@… added

I think it is needed to check BROWSER_VIEW permission with resource when processing request.

Patch (tested with r12742):

  • trac/versioncontrol/web_ui/browser.py

     
    326326            return True
    327327
    328328    def process_request(self, req):
    329         req.perm.require('BROWSER_VIEW')
    330 
    331329        presel = req.args.get('preselected')
    332330        if presel and (presel + '/').startswith(req.href.browser() + '/'):
    333331            req.redirect(presel)
     
    389387                                                   version=rev_or_latest))
    390388            display_rev = repos.display_rev
    391389
     390        if node:
     391            req.perm(node.resource).require('BROWSER_VIEW')
     392        else:
     393            req.perm.require('BROWSER_VIEW')
     394
    392395        # Prepare template data
    393396        path_links = get_path_links(req.href, reponame, path, rev,
    394397                                    order, desc)

comment:5 by Ryan J Ollos, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.