mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Updates to permissions checks (and tests), add logging around permission checks, permission-related fixes to support browsable API, work in progress on job templates API, added default logging settings.
This commit is contained in:
@@ -904,6 +904,11 @@ class JobTemplate(CommonModel):
|
||||
)
|
||||
return cls.can_user_add(user, data)
|
||||
|
||||
@classmethod
|
||||
def can_user_administrate(cls, user, obj, data):
|
||||
'''
|
||||
'''
|
||||
|
||||
@classmethod
|
||||
def can_user_add(cls, user, data):
|
||||
'''
|
||||
@@ -916,6 +921,8 @@ class JobTemplate(CommonModel):
|
||||
|
||||
if user.is_superuser:
|
||||
return True
|
||||
if not data or '_method' in data: # FIXME: So the browseable API will work?
|
||||
return True
|
||||
project = Project.objects.get(pk=data['project'])
|
||||
inventory = Inventory.objects.get(pk=data['inventory'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user