mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 21:07:39 -02:30
filter /api/v2/users/N/tokens/ to only show tokens for _that_ user
see: https://github.com/ansible/tower/issues/1773
This commit is contained in:
@@ -1598,6 +1598,18 @@ class OAuth2TokenList(ListCreateAPIView):
|
||||
model = OAuth2AccessToken
|
||||
serializer_class = OAuth2TokenSerializer
|
||||
swagger_topic = 'Authentication'
|
||||
|
||||
|
||||
class OAuth2UserTokenList(SubListCreateAPIView):
|
||||
|
||||
view_name = _("OAuth2 User Tokens")
|
||||
|
||||
model = OAuth2AccessToken
|
||||
serializer_class = OAuth2TokenSerializer
|
||||
parent_model = User
|
||||
relationship = 'main_oauth2accesstoken'
|
||||
parent_key = 'user'
|
||||
swagger_topic = 'Authentication'
|
||||
|
||||
|
||||
class OAuth2AuthorizedTokenList(SubListCreateAPIView):
|
||||
|
||||
Reference in New Issue
Block a user