Fix bug where members=@all didn't actually give access.
This commit is contained in:
parent
5b3f2f7a4d
commit
b04fbb1df7
2 changed files with 13 additions and 1 deletions
|
@ -19,7 +19,11 @@ def _getMembership(config, user, seen):
|
|||
else:
|
||||
members = members.split()
|
||||
|
||||
if user in members:
|
||||
# @all is the only group where membership needs to be
|
||||
# bootstrapped like this, anything else gets started from the
|
||||
# username itself
|
||||
if (user in members
|
||||
or '@all' in members):
|
||||
log.debug('found %(user)r in %(group)r' % dict(
|
||||
user=user,
|
||||
group=group,
|
||||
|
|
|
@ -78,6 +78,14 @@ def test_read_yes_map_wouldHaveWritable():
|
|||
eq(access.haveAccess(config=cfg, user='jdoe', mode='readonly', path='foo/bar'),
|
||||
None)
|
||||
|
||||
def test_read_yes_all():
|
||||
cfg = RawConfigParser()
|
||||
cfg.add_section('group fooers')
|
||||
cfg.set('group fooers', 'members', '@all')
|
||||
cfg.set('group fooers', 'readonly', 'foo/bar')
|
||||
eq(access.haveAccess(config=cfg, user='jdoe', mode='readonly', path='foo/bar'),
|
||||
('repositories', 'foo/bar'))
|
||||
|
||||
def test_base_global_absolute():
|
||||
cfg = RawConfigParser()
|
||||
cfg.add_section('gitosis')
|
||||
|
|
Loading…
Reference in a new issue