Skip to content

Conversation

@david-crespo
Copy link
Contributor

@david-crespo david-crespo commented Aug 19, 2025

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.

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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@jmpesp jmpesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the simplicity of this 🚀

@david-crespo david-crespo merged commit c52ed36 into main Aug 20, 2025
17 checks passed
@david-crespo david-crespo deleted the add-perms-session-me branch August 20, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants