Class RoleGrantedAuthorityUtils

java.lang.Object
io.jmix.security.role.RoleGrantedAuthorityUtils

@Component("sec_RoleGrantedAuthorityUtils") public class RoleGrantedAuthorityUtils extends Object
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 Details

    • RoleGrantedAuthorityUtils

      public RoleGrantedAuthorityUtils(SecurityProperties securityProperties)
  • 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)
      Creates GrantedAuthority for the given ResourceRole
    • createResourceRoleGrantedAuthority

      public org.springframework.security.core.GrantedAuthority createResourceRoleGrantedAuthority(String resourceRoleCode)
      Creates GrantedAuthority for the ResourceRole with the given code
    • createRowLevelRoleGrantedAuthority

      public org.springframework.security.core.GrantedAuthority createRowLevelRoleGrantedAuthority(RowLevelRole rowLevelRole)
      Creates GrantedAuthority for the given RowLevelRole
    • createRowLevelRoleGrantedAuthority

      public org.springframework.security.core.GrantedAuthority createRowLevelRoleGrantedAuthority(String rowLevelRoleCode)
      Creates GrantedAuthority for the RowLevelRole with the given code
    • getDefaultRolePrefix

      public String getDefaultRolePrefix()
      Returns the role prefix for the resource role. It is taken from the GrantedAuthorityDefaults if the bean of this type is defined. Otherwise, the default ROLE_ value is returned.
    • getDefaultRowLevelRolePrefix

      public String getDefaultRowLevelRolePrefix()
      Returns the role prefix for the row-level role (ROW_LEVEL_ROLE_ by default)