Expose the authenticated user's roles and service access on a charger - #48
Open
martijnversluis wants to merge 1 commit into
Open
Expose the authenticated user's roles and service access on a charger#48martijnversluis wants to merge 1 commit into
martijnversluis wants to merge 1 commit into
Conversation
The charger detail already carries CurrentUserRoles and the service-level technical read-access flag; surfacing them lets callers tell an owner from a lower access level instead of treating every Forbidden response as a full loss of access.
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.
De charger-detail (
GET /api/chargers/{id}) bevat alCurrentUserRoles(bitmask) enCurrentUserHasServiceLevelTechnicalReadAccess, maar onzeZaptec::Charger-wrapper gooide die weg. Daardoor kunnen we een ingetrokken Owner-permissie niet onderscheiden van volledig verlies van toegang.Deze wrapper stelt nu beschikbaar:
current_user_roles(int bitmask)owner?,user?,maintainer?,administrator?,technical?role_names(voor logging/mails)service_level_technical_read_access?Aanleiding: een klant trok in de Zaptec-app de Owner-permissie in (Service bleef staan). De sessie-import kreeg een 403 en Stekker ontkoppelde de lader automatisch. Met deze velden kan StekkerWeb straks bij een 403 eerst checken of alleen Owner weg is, de klant een melding sturen en de koppeling behouden i.p.v. verbreken.