Interface Role

  • All Superinterfaces:
    java.lang.Cloneable, PersistenceEntity

    public interface Role
    extends PersistenceEntity
    User role for access control. A user can have a number of roles, and a role can own a number of permissions and access tokens. Permissions, defined by modules, are the privileges of taking certain actions in the scope of a data access unit or a type of entities. Access tokens are defined by user, and their scopes are defined by modules. A role's permission is equivalent to an AccessItem (of AccessToken) with AccessItem.SCOPE_ALL scope.
    Since:
    3.2
    • Field Detail

      • PROPERTY_PERMISSIONS

        static final java.lang.String PROPERTY_PERMISSIONS
        property name: permissions
        Since:
        5.16
        See Also:
        Constant Field Values
      • PROPERTY_ACCESS_TOKENS

        static final java.lang.String PROPERTY_ACCESS_TOKENS
        property name: accessTokens
        Since:
        5.16
        See Also:
        Constant Field Values
      • PROPERTY_NAME

        static final java.lang.String PROPERTY_NAME
        property name: name
        See Also:
        Constant Field Values
      • USER

        static final java.lang.String USER
        User role name: User. All authenticated users have this role.
        See Also:
        Constant Field Values
      • SYSTEM_USER

        static final java.lang.String SYSTEM_USER
        System user role name: SystemUser. For system instance or single identity is not enabled, system users are specified by user.type(SYSTEM). Otherwise, they need to be assigned the SYSTEM_USER role.
        See Also:
        Constant Field Values
      • SUPER_USER

        static final java.lang.String SUPER_USER
        Super user role name: SuperUser. A superuser has all permissions.
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        java.lang.String getName()
        Get the role name
        Returns:
        role name
      • setName

        void setName​(java.lang.String name)
        Set the role name
        Parameters:
        name - the role name to set
      • getPermissions

        java.util.List<Permission> getPermissions()
        Get the list of permissions that this role owns.
        Returns:
        permissions
      • setPermissions

        void setPermissions​(java.util.List<Permission> permissions)
        Set the list of permissions that this role owns.
        Parameters:
        permissions - a list of permissions
      • getAccessTokens

        java.util.List<AccessToken> getAccessTokens()
        Get the list of AccessTokens that this role owns.
        Returns:
        access tokens
        Since:
        5.16
      • setAccessTokens

        void setAccessTokens​(java.util.List<AccessToken> accessTokens)
        Set the list of AccessTokens that this role owns.
        Parameters:
        accessTokens - a list of access tokens
        Since:
        5.16