Add boolean fleet_viewer and silo_admin to /v1/me response#8861
Merged
Conversation
jmpesp
reviewed
Aug 19, 2025
Comment on lines
+7158
to
+7165
| fleet_viewer: opctx | ||
| .authorize(authz::Action::Read, &authz::FLEET) | ||
| .await | ||
| .is_ok(), | ||
| silo_admin: opctx | ||
| .authorize(authz::Action::Modify, &authz_silo) | ||
| .await | ||
| .is_ok(), |
Contributor
There was a problem hiding this comment.
What about a separate field (or array) for each action type? will clients ever need more information, like "what if this user has read but not modify on a silo?"
Contributor
Author
There was a problem hiding this comment.
Currently everyone has silo viewer on their silo. The distinction between silo collaborator and silo admin could be come relevant (or fleet viewer and fleet admin), but I can't think of a case in the client where we need to know that yet. I am inclined to not bother until we need it.
jmpesp
approved these changes
Aug 19, 2025
jmpesp
left a comment
Contributor
There was a problem hiding this comment.
I really like the simplicity of this 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Dramatically simpler alternative to #8515. Rather than doing the rigmarole required to get the actual specific role on the fleet and silo, we just do little authz checks to get the specific things we care about. The web console is the only consumer that cares about this endpoint so it feels fine to do it that way.