Skip to content

Commit 79420ce

Browse files
author
utopiste
committed
Work on the authz_svn support, begin the job for parsing groups
git-svn-id: http://trac.edgewall.org/intertrac/log:/trunk@907 af82e41b-90c4-0310-8c96-b1721e28e2e2
1 parent 7b02333 commit 79420ce

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

AUTHORS

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ Jonas Borgstr
22
Daniel Lundin <[email protected]>
33
Rocky Burt <[email protected]>
44
Christopher Lenz <[email protected]>
5+
Francois Harvey <[email protected]>
56

6-
See also THANKS for people who have contributed to the project.
7+
See also THANKS for people who have contributed to the project.

trac/authzperm.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import os
2626

2727
class AuthzPermissionError (StandardError):
28-
"""Insufficient permissions to view this file"""
28+
"""Insufficient permission to view this file"""
2929
def __str__ (self):
30-
return 'authz read privileges required to view this file'
30+
return 'Insufficient permission to view this file (mod_authz_svn)'
3131

3232

3333
class AuthzPermission:
@@ -46,7 +46,14 @@ def __init__(self,env,authname):
4646
if env.get_config('trac','authz_file'):
4747
self.conf_authz = ConfigParser.ConfigParser()
4848
self.conf_authz.read( self.autz_file )
49-
49+
50+
def group_contains_user(self, group_name, user_name):
51+
if self.conf_authz.has_section('groups'):
52+
if self.conf_authz.has_option('groups', group_name):
53+
users_list = self.conf_authz.get('groups', group_name).split(',')
54+
return users_list.has_key(user_name)
55+
return False
56+
5057
def has_permission(self, path):
5158
acc = 'r'
5259

0 commit comments

Comments
 (0)