Interface CapabilityService

  • All Known Implementing Classes:
    CapabilityServiceImpl

    @AlfrescoPublicApi
    public interface CapabilityService
    Capability service implementation
    Since:
    2.0
    Author:
    Roy Wetherall
    • Method Detail

      • registerCapability

        void registerCapability​(Capability capability)
        Register a capability
        Parameters:
        capability - capability
      • getCapability

        Capability getCapability​(String name)
        Get a named capability.
        Parameters:
        name - capability name
        Returns:
        Capability capability or null if not found
      • getCapabilities

        Set<Capability> getCapabilities()
        Get a list of all the assignable capabilities.
        Returns:
        Set<Capability> set of all the assignable capabilities
      • getCapabilities

        Set<Capability> getCapabilities​(boolean includePrivate)
        Get a list of all the capabilities, optionally including those that are non-assignable.
        Parameters:
        includePrivate - indicates that the private, or non-assignable capabilities are included in the result
        Returns:
        Set<Capability> set of capabilities
      • getCapabilitiesAccessState

        Map<Capability,​org.alfresco.service.cmr.security.AccessStatus> getCapabilitiesAccessState​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Get all the capabilities access state based on the current user for the assignable capabilities.
        Parameters:
        nodeRef - node reference
        Returns:
      • getCapabilitiesAccessState

        Map<Capability,​org.alfresco.service.cmr.security.AccessStatus> getCapabilitiesAccessState​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                                                        boolean includePrivate)
        Get all the capabilities access state based on the current user.
        Parameters:
        nodeRef - node reference
        Returns:
      • getCapabilitiesAccessState

        Map<Capability,​org.alfresco.service.cmr.security.AccessStatus> getCapabilitiesAccessState​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                                                        List<String> capabilityNames)
        Parameters:
        nodeRef -
        capabilityNames -
        Returns:
      • getCapabilityAccessState

        org.alfresco.service.cmr.security.AccessStatus getCapabilityAccessState​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                                String capabilityName)
        Helper method to get the access state for a single capability.
        Parameters:
        nodeRef -
        capabilityName -
        Returns:
      • getGroups

        List<Group> getGroups()
        Gets the list of all the capability groups (in index order)
        Returns:
        List<Group> List of all the capability groups (in index order)
      • getCapabilitiesByGroupId

        List<Capability> getCapabilitiesByGroupId​(String groupId)
        Gets a list of capabilities for the given group id
        Parameters:
        groupId - The id of a group for which the list of capabilities should be retrieved
        Returns:
        List<Capability> List of capabilities for the given group
      • getCapabilitiesByGroup

        List<Capability> getCapabilitiesByGroup​(Group group)
        Get a list of capabilities for the given group
        Parameters:
        group - The group for which the list of capabilities should be retrieved
        Returns:
        List<Capability> List of capabilities for the given group
      • getGroup

        Group getGroup​(String groupId)
        Gets a group from it's id
        Parameters:
        groupId - The id of the group which should be retrieved
        Returns:
        Group The group with the id groupId
      • addGroup

        void addGroup​(Group group)
        Adds a group to the list of groups
        Parameters:
        group - The group which should be added
      • removeGroup

        void removeGroup​(Group group)
        Removes a group from the list of groups
        Parameters:
        group - The group which should be removed
      • hasCapability

        boolean hasCapability​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                              String capabilityName)
        Check if the current user has the given capability.
        Parameters:
        capabilityName -
        Returns: