Edgewall Software

Ticket #9542: 9542-handle-log-r9987.patch

File 9542-handle-log-r9987.patch, 1.2 KB (added by rblank, 22 months ago)

Also handle LOG_VIEW. Applies on top of 9542-source-perms-r9987.patch.

  • trac/versioncontrol/svn_authz.py

    diff --git a/trac/versioncontrol/svn_authz.py b/trac/versioncontrol/svn_authz.py
    a b  
    139139            usernames = ('$anonymous', '*') 
    140140        else: 
    141141            usernames = (username, '$authenticated', '*') 
    142         if action == 'FILE_VIEW' or action == 'BROWSER_VIEW': 
     142        if action in ('BROWSER_VIEW', 'FILE_VIEW', 'LOG_VIEW'): 
    143143            authz, users = self._get_authz_info() 
    144144            if authz is None: 
    145145                return False 
  • trac/versioncontrol/tests/svn_authz.py

    diff --git a/trac/versioncontrol/tests/svn_authz.py b/trac/versioncontrol/tests/svn_authz.py
    a b  
    200200        """ 
    201201        resource = Resource('source', path, 
    202202                            parent=Resource('repository', reponame)) 
    203         check = self.policy.check_permission('FILE_VIEW', user, resource, None) 
    204         self.assertEqual(result, check) 
     203        for perm in ('BROWSER_VIEW', 'FILE_VIEW', 'LOG_VIEW'): 
     204            check = self.policy.check_permission(perm, user, resource, None) 
     205            self.assertEqual(result, check) 
    205206         
    206207    def test_default_permission(self): 
    207208        # By default, permissions are undecided