Interface PrivilegeService
- All Known Implementing Classes:
DefaultPrivilegeService
public interface PrivilegeService
A service that contains various utility functions related to
Restriction
,
RestrictedRole
, and RestrictedPermission
.
These functions are most useful for consolidation purposes to obtain user's
flat permissions
, flat roles
restrictions
, restricted roles
,
restricted permissions
,
AuthorizationServer.getDefaultUserPermissions()
, and
AuthorizationServer.getDefaultUserRoles()
for building JWT claims.
-
Method Summary
Modifier and TypeMethodDescriptiongetRestrictionTargetsByRestrictionType
(@NonNull Set<Restriction> restrictions) Converts the Set ofRestriction
to a Map with the structure of: {restrictionType: [restrictionTargets]}.getUserPrivilegeSummary
(@NonNull User user, @NonNull String serverId) Gets aPrivilegeSummary
of user's consolidated authorities, restrictions, and restricted authorities.
-
Method Details
-
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:
-
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
-