Orgs: Use create-organization capability to control access
This is more explicit and future-proof than checking for admin cap.
This commit is contained in:
parent
72404d0fd9
commit
40172bf8b5
@ -18,7 +18,7 @@ def pre_get_organizations(request, lookup):
|
||||
|
||||
def pre_post_organizations(request):
|
||||
user = current_user()
|
||||
if user.is_anonymous or not user.has_cap('admin'):
|
||||
if not user.has_cap('create-organization'):
|
||||
raise wz_exceptions.Forbidden()
|
||||
|
||||
|
||||
|
@ -167,5 +167,5 @@ USER_CAPABILITIES = defaultdict(**{
|
||||
'subscriber': {'subscriber', 'home-project'},
|
||||
'demo': {'subscriber', 'home-project'},
|
||||
'admin': {'subscriber', 'home-project', 'video-encoding', 'admin',
|
||||
'view-pending-nodes', 'edit-project-node-types'},
|
||||
'view-pending-nodes', 'edit-project-node-types', 'create-organization'},
|
||||
}, default_factory=frozenset)
|
||||
|
Loading…
x
Reference in New Issue
Block a user