mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -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
|
||||
|
||||
# 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
|
||||
|
||||
def can_change(self, obj, data):
|
||||
|
||||
Reference in New Issue
Block a user