mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
allow can_add to be called for permission info
* can_add() is called through our generic permission/access framework for api creation (POST). However, can_add() may also be called for purposes of determining if a user has perms to do something. Thus, the data field may not contain 'name' in this case. Allow for that.
This commit is contained in:
@@ -614,7 +614,7 @@ class HostAccess(BaseAccess):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# Check to see if we have enough licenses
|
# Check to see if we have enough licenses
|
||||||
self.check_license(add_host_name=data['name'])
|
self.check_license(add_host_name=data.get('name', None))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def can_change(self, obj, data):
|
def can_change(self, obj, data):
|
||||||
|
|||||||
Reference in New Issue
Block a user