Class StudioMessageSecurityExpressionRoot
- java.lang.Object
-
- org.springframework.security.access.expression.SecurityExpressionRoot
-
- org.springframework.security.messaging.access.expression.MessageSecurityExpressionRoot
-
- org.craftercms.studio.impl.v2.utils.spring.security.messaging.StudioMessageSecurityExpressionRoot
-
- All Implemented Interfaces:
org.springframework.security.access.expression.SecurityExpressionOperations
public class StudioMessageSecurityExpressionRoot extends org.springframework.security.messaging.access.expression.MessageSecurityExpressionRoot
Extension ofMessageSecurityExpressionRoot
that adds Studio specific security expressions.- Since:
- 4.0.0
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected GroupServiceInternal
groupServiceInternal
protected UserServiceInternal
userServiceInternal
-
Constructor Summary
Constructors Constructor Description StudioMessageSecurityExpressionRoot(org.springframework.security.core.Authentication authentication, org.springframework.messaging.Message<?> message, UserServiceInternal userServiceInternal, GroupServiceInternal groupServiceInternal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
containsSystemAdminGroup(List<Group> groups)
boolean
isSiteMember(String siteId)
Checks if the current user belongs to any group in the given siteboolean
isSystemAdmin()
Checks if the current user belongs to thesystem_admin
group-
Methods inherited from class org.springframework.security.access.expression.SecurityExpressionRoot
denyAll, getAuthentication, getPrincipal, hasAnyAuthority, hasAnyRole, hasAuthority, hasPermission, hasPermission, hasRole, isAnonymous, isAuthenticated, isFullyAuthenticated, isRememberMe, permitAll, setDefaultRolePrefix, setPermissionEvaluator, setRoleHierarchy, setTrustResolver
-
-
-
-
Field Detail
-
userServiceInternal
protected UserServiceInternal userServiceInternal
-
groupServiceInternal
protected GroupServiceInternal groupServiceInternal
-
-
Constructor Detail
-
StudioMessageSecurityExpressionRoot
public StudioMessageSecurityExpressionRoot(org.springframework.security.core.Authentication authentication, org.springframework.messaging.Message<?> message, UserServiceInternal userServiceInternal, GroupServiceInternal groupServiceInternal)
-
-
Method Detail
-
isSystemAdmin
public boolean isSystemAdmin()
Checks if the current user belongs to thesystem_admin
group
-
isSiteMember
public boolean isSiteMember(String siteId)
Checks if the current user belongs to any group in the given site- Parameters:
siteId
- the id of the site to check
-
-