1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

add use to credential user_capabilities

This commit is contained in:
Jake McDermott 2019-03-25 15:24:30 -04:00
parent 8c3dfe8655
commit f611d4275f
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
2 changed files with 6 additions and 1 deletions

View File

@ -2584,7 +2584,7 @@ class V2CredentialFields(BaseSerializer, metaclass=BaseSerializerMetaclass):
class CredentialSerializer(BaseSerializer):
show_capabilities = ['edit', 'delete', 'copy']
show_capabilities = ['edit', 'delete', 'copy', 'use']
capabilities_prefetch = ['admin', 'use']
class Meta:

View File

@ -1162,6 +1162,11 @@ class CredentialAccess(BaseAccess):
# return True
return self.can_change(obj, None)
def get_user_capabilities(self, obj, **kwargs):
user_capabilities = super(CredentialAccess, self).get_user_capabilities(obj, **kwargs)
user_capabilities['use'] = self.can_use(obj)
return user_capabilities
class CredentialInputSourceAccess(BaseAccess):
'''