ui: [BUGFIX] Ensure we use the ns query param name when requesting permissions #10608
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.
Previously when namespaces were enabled, we weren't requesting permission for the actively selected namespace, and instead always checking the permissions for the default namespace.
This PR ensures we request permissions for the actively selected namespace.
Notes:
All of the UI/API reading interaction uses a GET request with
?ns=
to specify the namespace, we have one API request which requires a POST with the request body containing theNamespace
. This is so we can request various pieces of information required for the UI using a method we can customise for exactly what we need (there are more details in the comments in the changeset here). Unfortunately we were passing through anspace
parameter instead of ans
parameter which is the param name we are expecting deeper down, pretty much a typo.An initial fix (6f00c81) meant converting this from nspace to ns inside the repository itself. But then I realized that the entire 'repository' interface as of not too long ago now uses/expects
ns
notnspace
, so in a follow up commit (5c86827) I undid the first approach and made the fix consistent with the rest of the interface.