Fix creation of repositories when having a creator permission
This fixes the grants on a user's session when creating a repository with only the creator permission Fixes #117
This commit is contained in:
parent
b7303665a2
commit
44f49a43dd
3 changed files with 72 additions and 12 deletions
14
initdb.py
14
initdb.py
|
@ -354,6 +354,10 @@ def populate_database():
|
|||
reader.verified = True
|
||||
reader.save()
|
||||
|
||||
creatoruser = model.create_user('creator', 'password', 'noc@thanks.com')
|
||||
creatoruser.verified = True
|
||||
creatoruser.save()
|
||||
|
||||
outside_org = model.create_user('outsideorg', 'password', 'no2@thanks.com')
|
||||
outside_org.verified = True
|
||||
outside_org.save()
|
||||
|
@ -490,6 +494,9 @@ def populate_database():
|
|||
|
||||
model.create_robot('neworgrobot', org)
|
||||
|
||||
ownerbot = model.create_robot('ownerbot', org)[0]
|
||||
creatorbot = model.create_robot('creatorbot', org)[0]
|
||||
|
||||
owners = model.get_organization_team('buynlarge', 'owners')
|
||||
owners.description = 'Owners have unfetterd access across the entire org.'
|
||||
owners.save()
|
||||
|
@ -504,12 +511,19 @@ def populate_database():
|
|||
[],
|
||||
(4, [], ['latest', 'prod']))
|
||||
|
||||
creators = model.create_team('creators', org, 'creator',
|
||||
'Creators of orgrepo.')
|
||||
|
||||
reader_team = model.create_team('readers', org, 'member',
|
||||
'Readers of orgrepo.')
|
||||
model.set_team_repo_permission(reader_team.name, org_repo.namespace_user.username, org_repo.name,
|
||||
'read')
|
||||
|
||||
model.add_user_to_team(new_user_2, reader_team)
|
||||
model.add_user_to_team(reader, reader_team)
|
||||
model.add_user_to_team(ownerbot, owners)
|
||||
model.add_user_to_team(creatorbot, creators)
|
||||
model.add_user_to_team(creatoruser, creators)
|
||||
|
||||
__generate_repository(new_user_1, 'superwide', None, False, [],
|
||||
[(10, [], 'latest2'),
|
||||
|
|
Reference in a new issue