Class MemoryRole

    • Method Detail

      • addPermission

        public void addPermission​(Permission memoryPermission)
        Description copied from interface: Role
        Adds a permission to the list
        Specified by:
        addPermission in interface Role
        Parameters:
        memoryPermission - the permission to add to the list
      • getName

        public String getName()
        Description copied from interface: Role
        Get the name. Must be unique. NOTE: This field is considered the Primary Key for this object.
        Specified by:
        getName in interface Role
        Returns:
        the name of the role
      • getPermissions

        public List<PermissiongetPermissions()
        Description copied from interface: Role
        Returns the list of permissions assigned to this role.
        Specified by:
        getPermissions in interface Role
        Returns:
        the list of permissions assigned to this role
      • isAssignable

        public boolean isAssignable()
        Description copied from interface: Role
        True, if this role is available to be assigned to a user, otherwise false.
        Specified by:
        isAssignable in interface Role
        Returns:
        true, if this role can be assigned to users, otherwise false
      • removePermission

        public void removePermission​(Permission memoryPermission)
        Description copied from interface: Role
        Removes the given permission from the list. If the permission does not exist in the list of assigned permissions, nothing happens.
        Specified by:
        removePermission in interface Role
        Parameters:
        memoryPermission - the permission to remove.
      • setAssignable

        public void setAssignable​(boolean assignable)
        Description copied from interface: Role
        Set to true, if this role should available to be assigned to a user
        Specified by:
        setAssignable in interface Role
        Parameters:
        assignable - the assignable flag
      • setDescription

        public void setDescription​(String description)
        Description copied from interface: Role
        Set the Description
        Specified by:
        setDescription in interface Role
        Parameters:
        description - the role description
      • setName

        public void setName​(String name)
        Description copied from interface: Role
        Set the role name NOTE: This field is considered the Primary Key for this object.
        Specified by:
        setName in interface Role
        Parameters:
        name - the role name
      • setPermissions

        public void setPermissions​(List<Permission> permissions)
        Description copied from interface: Role
        Set role permissions. The list of assigned permissions is replaced by this list.
        Specified by:
        setPermissions in interface Role
        Parameters:
        permissions - the permissions to set
      • addChildRoleName

        public void addChildRoleName​(String name)
        Description copied from interface: Role
        Adds a role to the list of child roles
        Specified by:
        addChildRoleName in interface Role
        Parameters:
        name - the name of the child role.
      • setChildRoleNames

        public void setChildRoleNames​(List<String> names)
        Description copied from interface: Role
        Sets the names of children roles. Children roles inherit the permissions of the parent role.
        Specified by:
        setChildRoleNames in interface Role
        Parameters:
        names - the list of names of child roles.
      • isPermanent

        public boolean isPermanent()
        Description copied from interface: Role
        Test to see if the object is a permanent object or not.
        Specified by:
        isPermanent in interface Role
        Returns:
        true, if the object is permanent.
      • setPermanent

        public void setPermanent​(boolean permanent)
        Description copied from interface: Role
        Set flag indicating if the object is a permanent object or not.
        Specified by:
        setPermanent in interface Role
        Parameters:
        permanent - true if the object is permanent.
      • getId

        public String getId()
        Description copied from interface: Role
        The role identifier. Should be built from the modelId and the resource. And must be unique.
        Specified by:
        getId in interface Role
        Returns:
        the role identifier
      • setId

        public void setId​(String id)
        Description copied from interface: Role
        Sets the role id
        Specified by:
        setId in interface Role
        Parameters:
        id - the identifier of the role, should not be null or empty.
      • getModelId

        public String getModelId()
        Description copied from interface: Role
        Returns the model the role is derived from.
        Specified by:
        getModelId in interface Role
        Returns:
        The model id or empty string, if this role was not created from a model
      • setModelId

        public void setModelId​(String modelId)
        Description copied from interface: Role
        Sets the model id.
        Specified by:
        setModelId in interface Role
        Parameters:
        modelId - the identifier of the model, or empty string. Should not be null.
      • getResource

        public String getResource()
        Description copied from interface: Role
        Returns the resource that is used to build this role from a template. If this is not a templated role, a empty string should be returned.
        Specified by:
        getResource in interface Role
        Returns:
        the resource identifier, used to build this role or a empty string, if this role is not templated
      • setResource

        public void setResource​(String resource)
        Description copied from interface: Role
        Sets the resource, this template instance is attached to.
        Specified by:
        setResource in interface Role
        Parameters:
        resource - the resource identifier. Must not be null.
      • isTemplateInstance

        public boolean isTemplateInstance()
        Description copied from interface: Role
        Returns true, if this role is a instance of a template role, otherwise false. Templated roles are built from a template together with a resource identifier.
        Specified by:
        isTemplateInstance in interface Role
        Returns:
        true, if this role is a templated role, otherwise false
      • setTemplateInstance

        public void setTemplateInstance​(boolean templateInstance)
        Description copied from interface: Role
        Sets the template instance flag.
        Specified by:
        setTemplateInstance in interface Role
        Parameters:
        templateInstance - Set to true, if this is a template instance, otherwise false