Interface PrivilegeService
-
- All Known Implementing Classes:
DefaultPrivilegeService
public interface PrivilegeService
A 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 roles
restrictions
,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 ofRestriction
to a Map with the structure of: {restrictionType: [restrictionTargets]}.PrivilegeSummary
getUserPrivilegeSummary(@NonNull User user, @NonNull String serverId)
Gets aPrivilegeSummary
of user's consolidated authorities, restrictions, and restricted authorities.
-
-
-
Method Detail
-
getUserPrivilegeSummary
PrivilegeSummary getUserPrivilegeSummary(@NonNull @NonNull User user, @NonNull @NonNull String serverId)
Gets aPrivilegeSummary
of user's consolidated authorities, restrictions, and restricted authorities.- Parameters:
user
-User
to get thePrivilegeSummary
forserverId
- id of theAuthorizationServer
- Returns:
- a
PrivilegeSummary
of user's authorities, restrictions, and restricted authorities - See Also:
PrivilegeSummary
-
getRestrictionTargetsByRestrictionType
Map<String,Set<String>> getRestrictionTargetsByRestrictionType(@NonNull @NonNull Set<Restriction> restrictions)
Converts the Set ofRestriction
to a Map with the structure of: {restrictionType: [restrictionTargets]}.- Parameters:
restrictions
-Set
ofRestriction
- Returns:
- a map with restriction type as key and restriction targets as value converted from the given set of restrictions
-
-