Interface CapabilityService
- All Known Implementing Classes:
CapabilityServiceImpl
@AlfrescoPublicApi
public interface CapabilityService
Capability service implementation
- Since:
- 2.0
- Author:
- Roy Wetherall
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a group to the list of groupsGet a list of all the assignable capabilities.getCapabilities
(boolean includePrivate) Get a list of all the capabilities, optionally including those that are non-assignable.getCapabilitiesAccessState
(NodeRef nodeRef) Get all the capabilities access state based on the current user for the assignable capabilities.getCapabilitiesAccessState
(NodeRef nodeRef, boolean includePrivate) Get all the capabilities access state based on the current user.getCapabilitiesAccessState
(NodeRef nodeRef, List<String> capabilityNames) getCapabilitiesByGroup
(Group group) Get a list of capabilities for the given groupgetCapabilitiesByGroupId
(String groupId) Gets a list of capabilities for the given group idgetCapability
(String name) Get a named capability.getCapabilityAccessState
(NodeRef nodeRef, String capabilityName) Helper method to get the access state for a single capability.Gets a group from it's idGets the list of all the capability groups (in index order)boolean
hasCapability
(NodeRef nodeRef, String capabilityName) Check if the current user has the given capability.void
registerCapability
(Capability capability) Register a capabilityvoid
removeGroup
(Group group) Removes a group from the list of groups
-
Method Details
-
registerCapability
Register a capability- Parameters:
capability
- capability
-
getCapability
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
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
Get all the capabilities access state based on the current user for the assignable capabilities.- Parameters:
nodeRef
- node reference- Returns:
-
getCapabilitiesAccessState
Get all the capabilities access state based on the current user.- Parameters:
nodeRef
- node reference- Returns:
-
getCapabilitiesAccessState
Map<Capability,AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames) - Parameters:
nodeRef
-capabilityNames
-- Returns:
-
getCapabilityAccessState
Helper method to get the access state for a single capability.- Parameters:
nodeRef
-capabilityName
-- Returns:
-
getGroups
Gets the list of all the capability groups (in index order) -
getCapabilitiesByGroupId
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
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
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
Adds a group to the list of groups- Parameters:
group
- The group which should be added
-
removeGroup
Removes a group from the list of groups- Parameters:
group
- The group which should be removed
-
hasCapability
Check if the current user has the given capability.- Parameters:
capabilityName
-- Returns:
-