Class AdminPrivilegeService.PrivilegeHydrationResult
java.lang.Object
com.broadleafcommerce.adminuser.user.service.AdminPrivilegeService.PrivilegeHydrationResult
- Enclosing class:
- AdminPrivilegeService
An intermediary data structure used internally by
AdminPrivilegeService to hold data
for a user or role entity to prevent querying the data multiple times.
When it's used for the user entity, all of its restrictions, flat
permissions, restricted roles, and restricted permissions are stored.
When it's used for the role entity, only the flat permissions are
stored.
-
Constructor Summary
ConstructorsConstructorDescriptionPrivilegeHydrationResult(Set<AdminPermissionRef> flatPermissions, Set<AdminRestriction> restrictions, Set<AdminRestrictedRole> restrictedRoles, Map<String, Collection<AdminRoleRef>> restrictedRoleWithAncestorsByRestrictedRoleId, Set<AdminRestrictedPermission> restrictedPermissions) Creates a newPrivilegeHydrationResultinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanWhen hydrating for anAdminUser, this field contains all of the flat permissions fromAdminUser.getPermissions(), includingAdminRoleRef.getPermissions()()} inherited fromAdminUser.getRoles()and their ancestors.All of the directly assignedAdminUser.getRestrictedPermissions()from anAdminUser, this does not include anything fromAdminUser.getRoles().All of theAdminUser.getRestrictedRoles().All of the hydratedAdminUser.getRestrictedRoles()along with their ancestors mapped by the restricted role id.All of theAdminUser.getRestrictions().inthashCode()voidsetFlatPermissions(Set<AdminPermissionRef> flatPermissions) When hydrating for anAdminUser, this field contains all of the flat permissions fromAdminUser.getPermissions(), includingAdminRoleRef.getPermissions()()} inherited fromAdminUser.getRoles()and their ancestors.voidsetRestrictedPermissions(Set<AdminRestrictedPermission> restrictedPermissions) All of the directly assignedAdminUser.getRestrictedPermissions()from anAdminUser, this does not include anything fromAdminUser.getRoles().voidsetRestrictedRoles(Set<AdminRestrictedRole> restrictedRoles) All of theAdminUser.getRestrictedRoles().voidsetRestrictedRoleWithAncestorsByRestrictedRoleId(Map<String, Collection<AdminRoleRef>> restrictedRoleWithAncestorsByRestrictedRoleId) All of the hydratedAdminUser.getRestrictedRoles()along with their ancestors mapped by the restricted role id.voidsetRestrictions(Set<AdminRestriction> restrictions) All of theAdminUser.getRestrictions().toString()
-
Constructor Details
-
PrivilegeHydrationResult
public PrivilegeHydrationResult(Set<AdminPermissionRef> flatPermissions, Set<AdminRestriction> restrictions, Set<AdminRestrictedRole> restrictedRoles, Map<String, Collection<AdminRoleRef>> restrictedRoleWithAncestorsByRestrictedRoleId, Set<AdminRestrictedPermission> restrictedPermissions) Creates a newPrivilegeHydrationResultinstance.- Parameters:
flatPermissions- When hydrating for anAdminUser, this field contains all of the flat permissions fromAdminUser.getPermissions(), includingAdminRoleRef.getPermissions()()} inherited fromAdminUser.getRoles()and their ancestors.When hydrating for an
AdminRoleRef, this field contains all of the flat permissions fromAdminRoleRef.getPermissions(), including those inherited from its ancestors.restrictions- All of theAdminUser.getRestrictions(). This field is only relevant and hydrated forAdminUser.restrictedRoles- All of theAdminUser.getRestrictedRoles(). This field is only relevant and hydrated forAdminUser.restrictedRoleWithAncestorsByRestrictedRoleId- All of the hydratedAdminUser.getRestrictedRoles()along with their ancestors mapped by the restricted role id. This field is only relevant and hydrated forAdminUser.restrictedPermissions- All of the directly assignedAdminUser.getRestrictedPermissions()from anAdminUser, this does not include anything fromAdminUser.getRoles(). This field is only relevant and hydrated forAdminUser.
-
-
Method Details
-
getFlatPermissions
When hydrating for anAdminUser, this field contains all of the flat permissions fromAdminUser.getPermissions(), includingAdminRoleRef.getPermissions()()} inherited fromAdminUser.getRoles()and their ancestors.When hydrating for an
AdminRoleRef, this field contains all of the flat permissions fromAdminRoleRef.getPermissions(), including those inherited from its ancestors. -
getRestrictions
All of theAdminUser.getRestrictions(). This field is only relevant and hydrated forAdminUser. -
getRestrictedRoles
All of theAdminUser.getRestrictedRoles(). This field is only relevant and hydrated forAdminUser. -
getRestrictedRoleWithAncestorsByRestrictedRoleId
All of the hydratedAdminUser.getRestrictedRoles()along with their ancestors mapped by the restricted role id. This field is only relevant and hydrated forAdminUser. -
getRestrictedPermissions
All of the directly assignedAdminUser.getRestrictedPermissions()from anAdminUser, this does not include anything fromAdminUser.getRoles(). This field is only relevant and hydrated forAdminUser. -
setFlatPermissions
When hydrating for anAdminUser, this field contains all of the flat permissions fromAdminUser.getPermissions(), includingAdminRoleRef.getPermissions()()} inherited fromAdminUser.getRoles()and their ancestors.When hydrating for an
AdminRoleRef, this field contains all of the flat permissions fromAdminRoleRef.getPermissions(), including those inherited from its ancestors. -
setRestrictions
All of theAdminUser.getRestrictions(). This field is only relevant and hydrated forAdminUser. -
setRestrictedRoles
All of theAdminUser.getRestrictedRoles(). This field is only relevant and hydrated forAdminUser. -
setRestrictedRoleWithAncestorsByRestrictedRoleId
public void setRestrictedRoleWithAncestorsByRestrictedRoleId(Map<String, Collection<AdminRoleRef>> restrictedRoleWithAncestorsByRestrictedRoleId) All of the hydratedAdminUser.getRestrictedRoles()along with their ancestors mapped by the restricted role id. This field is only relevant and hydrated forAdminUser. -
setRestrictedPermissions
All of the directly assignedAdminUser.getRestrictedPermissions()from anAdminUser, this does not include anything fromAdminUser.getRoles(). This field is only relevant and hydrated forAdminUser. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-