comparison hgext/acl.py @ 16765:754e98e0a615

acl: added some comments to easily identify branch- and path-based verifications
author Elifarley Callado Coelho Cruz
date Fri, 18 May 2012 12:48:24 -0300
parents ffb68b9dbaa9
children 9d778f80ad2a
comparison
equal deleted inserted replaced
16764:ffb68b9dbaa9 16765:754e98e0a615
188 pats = [pat for pat, users in ui.configitems(key) 188 pats = [pat for pat, users in ui.configitems(key)
189 if _usermatch(ui, user, users)] 189 if _usermatch(ui, user, users)]
190 ui.debug('acl: %s enabled, %d entries for user %s\n' % 190 ui.debug('acl: %s enabled, %d entries for user %s\n' %
191 (key, len(pats), user)) 191 (key, len(pats), user))
192 192
193 # Branch-based ACL
193 if not repo: 194 if not repo:
194 if pats: 195 if pats:
195 return lambda b: '*' in pats or b in pats 196 return lambda b: '*' in pats or b in pats
196 return util.never 197 return util.never
197 198
199 # Path-based ACL
198 if pats: 200 if pats:
199 return match.match(repo.root, '', pats) 201 return match.match(repo.root, '', pats)
200 return match.exact(repo.root, '', []) 202 return match.exact(repo.root, '', [])
201 203
202 204