diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4571dd0525..7b8de0b1e3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -51,6 +51,9 @@ Fixed * For "local-shell-script" runner, on readonly filesystems, don't attempt to run chmod +x on script_action. Fixes #5591 Contributed by @jk464 +* Fixed RBAC support to action-alias help and match end point. #6022 + Contributed by @nzlosh + Added ~~~~~ * Move `git clone` to `user_home/.st2packs` #5845 diff --git a/st2api/st2api/controllers/v1/actionalias.py b/st2api/st2api/controllers/v1/actionalias.py index 5488300d6e..155ae81792 100644 --- a/st2api/st2api/controllers/v1/actionalias.py +++ b/st2api/st2api/controllers/v1/actionalias.py @@ -74,7 +74,7 @@ def get_one(self, ref_or_id, requester_user): ref_or_id, requester_user=requester_user, permission_type=permission_type ) - def match(self, action_alias_match_api): + def match(self, action_alias_match_api, requester_user): """ Find a matching action alias. @@ -99,7 +99,7 @@ def match(self, action_alias_match_api): "representation": format_["representation"], } - def help(self, filter, pack, limit, offset, **kwargs): + def help(self, filter, pack, limit, offset, requester_user, **kwargs): """ Get available help strings for action aliases. diff --git a/st2common/st2common/openapi.yaml b/st2common/st2common/openapi.yaml index 93d4bcdec6..f755687818 100644 --- a/st2common/st2common/openapi.yaml +++ b/st2common/st2common/openapi.yaml @@ -806,6 +806,11 @@ paths: description: Object containing the format to be matched. schema: $ref: '#/definitions/ActionAliasMatchRequest' + x-parameters: + - name: user + in: context + x-as: requester_user + description: User performing the operation. responses: '200': description: Action alias match pattern @@ -840,6 +845,11 @@ paths: description: Number of actions alias to offset type: integer default: 0 + x-parameters: + - name: user + in: context + x-as: requester_user + description: User performing the operation. responses: '200': description: Action alias match pattern diff --git a/st2common/st2common/openapi.yaml.j2 b/st2common/st2common/openapi.yaml.j2 index 6b10362640..45f126275a 100644 --- a/st2common/st2common/openapi.yaml.j2 +++ b/st2common/st2common/openapi.yaml.j2 @@ -802,6 +802,11 @@ paths: description: Object containing the format to be matched. schema: $ref: '#/definitions/ActionAliasMatchRequest' + x-parameters: + - name: user + in: context + x-as: requester_user + description: User performing the operation. responses: '200': description: Action alias match pattern @@ -836,6 +841,11 @@ paths: description: Number of actions alias to offset type: integer default: 0 + x-parameters: + - name: user + in: context + x-as: requester_user + description: User performing the operation. responses: '200': description: Action alias match pattern