Backport of api: refactor ACL check for namespace wildcard into release/1.3.x #13624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #13606 to be assessed for backporting due to the inclusion of the label backport/1.3.x.
The below text is copied from the body of the original PR.
Improve how the all namespaces wildcard (
*
) is handled when checkingACL permissions. When using the wildcard namespace the
AllowNsOp
wouldreturn false since it looks for a namespace called
*
to match.This commit changes this behavior to return
true
when the queriednamespace is
*
and the token allows the operation in any namespace.Actual permission must be checked per object. The helper function
AllowNsOpFunc
returns a function that can be used to make thisverification.
#13608 applies this changes to the existing Job and Alloc list endpoints.
#13530 applies this changes to the Eval list endpoint to fix a bug.
The work has been split to allow for easier backporting.