Package com.onec.ui
Class UiProfileResolver
java.lang.Object
com.onec.ui.UiProfileResolver
Resolves which
UiLayout.Profile a user sees, by matching their roles
against each named profile's target roles. Pure presentation/curation: this
decides what a cooperating client renders, never what data access is granted —
that stays enforced per data endpoint. Callers pass an already-normalized role
set (upper-case, ROLE_ stripped); profile role tokens are normalized
here so the two sides compare consistently.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLook up a profile by id for an explicit?profile=switch.Pick the best profile for a user: the highest-priority named profile whose roles intersectroles, falling back to the default profile when none match.switchable(UiLayout layout, Set<String> roles) The profiles a user may switch between.
-
Constructor Details
-
UiProfileResolver
public UiProfileResolver()
-
-
Method Details
-
resolve
Pick the best profile for a user: the highest-priority named profile whose roles intersectroles, falling back to the default profile when none match. Also returns the full set the user may switch between. -
switchable
The profiles a user may switch between. A user who matches one or more named profiles is confined to those — they cannot fall back to the default back-office. The default profile is offered only to users who match no named profile at all. This is what locks a curated persona (e.g. a cleaner) out of every other view: their role grants exactly one profile and nothing else is switchable. -
byId
Look up a profile by id for an explicit?profile=switch. Falls back to the default profile for null/blank/"default"/unknown ids. Note: this does not verify the user is eligible — callers that honor a client-supplied id should intersect withswitchable(com.onec.ui.UiLayout, java.util.Set<java.lang.String>)first.
-