- Fix namespace drop down to save the namespace last selected (and validate)
- Add a "can_create_repo" entry to the organization and have orgs grayed out in the new repo view if the user cannot create a repo - Fix the multiple-orgs bug in the model - Have the "create new repository" button disappear on landing if the org is selected and the user does not have create permissions for that org
This commit is contained in:
parent
4b460be4dd
commit
0c4dec6de4
10 changed files with 89 additions and 14 deletions
|
@ -84,7 +84,8 @@ def get_logged_in_user():
|
|||
return {
|
||||
'name': o.username,
|
||||
'gravatar': compute_hash(o.email),
|
||||
'is_org_admin': admin_org.can()
|
||||
'is_org_admin': admin_org.can(),
|
||||
'can_create_repo': admin_org.can() or CreateRepositoryPermission(o.username).can()
|
||||
}
|
||||
|
||||
if current_user.is_anonymous():
|
||||
|
@ -100,7 +101,8 @@ def get_logged_in_user():
|
|||
'email': user.email,
|
||||
'gravatar': compute_hash(user.email),
|
||||
'askForPassword': user.password_hash is None,
|
||||
'organizations': [org_view(o) for o in organizations]
|
||||
'organizations': [org_view(o) for o in organizations],
|
||||
'can_create_repo': True
|
||||
})
|
||||
|
||||
|
||||
|
|
Reference in a new issue