Interface PrivilegeService
-
- All Known Implementing Classes:
DefaultPrivilegeService
public interface PrivilegeServiceA service that contains various utility functions related toRestriction,RestrictedRole, andRestrictedPermission.These functions are most useful for consolidation purposes to obtain user's
flat permissions,flat rolesrestrictions,restricted roles,restricted permissions,AuthorizationServer.getDefaultUserPermissions(), andAuthorizationServer.getDefaultUserRoles()for building JWT claims.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Set<String>>getRestrictionTargetsByRestrictionType(@NonNull Set<Restriction> restrictions)Converts the Set ofRestrictionto a Map with the structure of: {restrictionType: [restrictionTargets]}.PrivilegeSummarygetUserPrivilegeSummary(@NonNull User user, @NonNull String serverId)Gets aPrivilegeSummaryof user's consolidated authorities, restrictions, and restricted authorities.
-
-
-
Method Detail
-
getUserPrivilegeSummary
PrivilegeSummary getUserPrivilegeSummary(@NonNull @NonNull User user, @NonNull @NonNull String serverId)
Gets aPrivilegeSummaryof user's consolidated authorities, restrictions, and restricted authorities.- Parameters:
user-Userto get thePrivilegeSummaryforserverId- id of theAuthorizationServer- Returns:
- a
PrivilegeSummaryof user's authorities, restrictions, and restricted authorities - See Also:
PrivilegeSummary
-
getRestrictionTargetsByRestrictionType
Map<String,Set<String>> getRestrictionTargetsByRestrictionType(@NonNull @NonNull Set<Restriction> restrictions)
Converts the Set ofRestrictionto a Map with the structure of: {restrictionType: [restrictionTargets]}.- Parameters:
restrictions-SetofRestriction- Returns:
- a map with restriction type as key and restriction targets as value converted from the given set of restrictions
-
-