Package io.jmix.security.role
Class RoleGrantedAuthorityUtils
java.lang.Object
io.jmix.security.role.RoleGrantedAuthorityUtils
Utility class for working with Jmix-related
GrantedAuthority
. Use this class when you need to
programmatically create an instance of the granted authority for resource or row-level role.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.GrantedAuthority
createResourceRoleGrantedAuthority
(ResourceRole resourceRole) CreatesGrantedAuthority
for the givenResourceRole
org.springframework.security.core.GrantedAuthority
createResourceRoleGrantedAuthority
(String resourceRoleCode) CreatesGrantedAuthority
for theResourceRole
with the given codeorg.springframework.security.core.GrantedAuthority
createRowLevelRoleGrantedAuthority
(RowLevelRole rowLevelRole) CreatesGrantedAuthority
for the givenRowLevelRole
org.springframework.security.core.GrantedAuthority
createRowLevelRoleGrantedAuthority
(String rowLevelRoleCode) CreatesGrantedAuthority
for theRowLevelRole
with the given codeReturns the role prefix for the resource role.Returns the role prefix for the row-level role (ROW_LEVEL_ROLE_ by default)void
init()
void
setGrantedAuthorityDefaults
(org.springframework.security.config.core.GrantedAuthorityDefaults grantedAuthorityDefaults)
-
Constructor Details
-
RoleGrantedAuthorityUtils
-
-
Method Details
-
setGrantedAuthorityDefaults
@Autowired(required=false) public void setGrantedAuthorityDefaults(org.springframework.security.config.core.GrantedAuthorityDefaults grantedAuthorityDefaults) -
init
@PostConstruct public void init() -
createResourceRoleGrantedAuthority
public org.springframework.security.core.GrantedAuthority createResourceRoleGrantedAuthority(ResourceRole resourceRole) CreatesGrantedAuthority
for the givenResourceRole
-
createResourceRoleGrantedAuthority
public org.springframework.security.core.GrantedAuthority createResourceRoleGrantedAuthority(String resourceRoleCode) CreatesGrantedAuthority
for theResourceRole
with the given code -
createRowLevelRoleGrantedAuthority
public org.springframework.security.core.GrantedAuthority createRowLevelRoleGrantedAuthority(RowLevelRole rowLevelRole) CreatesGrantedAuthority
for the givenRowLevelRole
-
createRowLevelRoleGrantedAuthority
public org.springframework.security.core.GrantedAuthority createRowLevelRoleGrantedAuthority(String rowLevelRoleCode) CreatesGrantedAuthority
for theRowLevelRole
with the given code -
getDefaultRolePrefix
Returns the role prefix for the resource role. It is taken from theGrantedAuthorityDefaults
if the bean of this type is defined. Otherwise, the default ROLE_ value is returned. -
getDefaultRowLevelRolePrefix
Returns the role prefix for the row-level role (ROW_LEVEL_ROLE_ by default)
-