-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: always send capabilities-self request in user's root namespace #24168
UI: always send capabilities-self request in user's root namespace #24168
Conversation
* @param {string} rootPath eg apps/prod | ||
* @returns the leftover segment, eg app_1/test | ||
*/ | ||
export function getRelativePath(fullPath = '', rootPath = '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially had this logic within the namespace computed property, but it was much easier to test as a util
Build Results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for the update.
…24168) * Add getRelativePath helper and use to calculate relativeNamespace * Always request capabilities-self on users root ns and prefix body with relative path * Update capabilities adapter with test * add changelog * Simplify getRelativePath logic * test update
…ashicorp#24168) (hashicorp#24204) * Add getRelativePath helper and use to calculate relativeNamespace * Always request capabilities-self on users root ns and prefix body with relative path * Update capabilities adapter with test * add changelog * Simplify getRelativePath logic * test update
sys/capabilities-self
is an endpoint the UI uses to surface actions that a user can take within the GUI. The endpoint is on the default policy so that users can by default use the UI in the intended way.However, the policy is only applicable to the namespace where the user's auth mount is, so a user with the default policy only who logs into a child namespace that they have access to might see an error related to capabilities-self, or erroneously see buttons for actions they don't have capabilities to perform.
This PR fixes that experience by ensuring the capabilities-self endpoint is always queried on the user's root namespace, and adds the rest of the current namespace to the beginning of the queried path.