Class CapabilityServiceImpl
- java.lang.Object
-
- org.alfresco.module.org_alfresco_module_rm.capability.CapabilityServiceImpl
-
- All Implemented Interfaces:
CapabilityService
public class CapabilityServiceImpl extends Object implements CapabilityService
- Since:
- 2.0
- Author:
- Roy Wetherall
-
-
Constructor Summary
Constructors Constructor Description CapabilityServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGroup(Group group)
Adds a group to the list of groupsSet<Capability>
getCapabilities()
Get a list of all the assignable capabilities.Set<Capability>
getCapabilities(boolean includePrivate)
Get a list of all the capabilities, optionally including those that are non-assignable.Map<Capability,AccessStatus>
getCapabilitiesAccessState(NodeRef nodeRef)
Get all the capabilities access state based on the current user for the assignable capabilities.Map<Capability,AccessStatus>
getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
Get all the capabilities access state based on the current user.Map<Capability,AccessStatus>
getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames)
List<Capability>
getCapabilitiesByGroup(Group group)
Get a list of capabilities for the given groupList<Capability>
getCapabilitiesByGroupId(String groupId)
Gets a list of capabilities for the given group idCapability
getCapability(String name)
Get a named capability.AccessStatus
getCapabilityAccessState(NodeRef nodeRef, String capabilityName)
Helper method to get the access state for a single capability.Group
getGroup(String groupId)
Gets a group from it's idList<Group>
getGroups()
Gets 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 Detail
-
getCapability
public Capability getCapability(String name)
Description copied from interface:CapabilityService
Get a named capability.- Specified by:
getCapability
in interfaceCapabilityService
- Parameters:
name
- capability name- Returns:
Capability
capability or null if not found- See Also:
CapabilityService.getCapability(java.lang.String)
-
registerCapability
public void registerCapability(Capability capability)
Description copied from interface:CapabilityService
Register a capability- Specified by:
registerCapability
in interfaceCapabilityService
- Parameters:
capability
- capability- See Also:
CapabilityService.registerCapability(org.alfresco.module.org_alfresco_module_rm.capability.Capability)
-
getCapabilities
public Set<Capability> getCapabilities()
Description copied from interface:CapabilityService
Get a list of all the assignable capabilities.- Specified by:
getCapabilities
in interfaceCapabilityService
- Returns:
Set
<Capability
> set of all the assignable capabilities- See Also:
CapabilityService.getCapabilities()
-
getCapabilities
public Set<Capability> getCapabilities(boolean includePrivate)
Description copied from interface:CapabilityService
Get a list of all the capabilities, optionally including those that are non-assignable.- Specified by:
getCapabilities
in interfaceCapabilityService
- Parameters:
includePrivate
- indicates that the private, or non-assignable capabilities are included in the result- Returns:
Set
<Capability
> set of capabilities- See Also:
CapabilityService.getCapabilities(boolean)
-
getCapabilitiesAccessState
public Map<Capability,AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef)
Description copied from interface:CapabilityService
Get all the capabilities access state based on the current user for the assignable capabilities.- Specified by:
getCapabilitiesAccessState
in interfaceCapabilityService
- Parameters:
nodeRef
- node reference- Returns:
- See Also:
CapabilityService.getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef)
-
getCapabilitiesAccessState
public Map<Capability,AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
Description copied from interface:CapabilityService
Get all the capabilities access state based on the current user.- Specified by:
getCapabilitiesAccessState
in interfaceCapabilityService
- Parameters:
nodeRef
- node reference- Returns:
- See Also:
CapabilityService.getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, boolean)
-
getCapabilitiesAccessState
public Map<Capability,AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames)
- Specified by:
getCapabilitiesAccessState
in interfaceCapabilityService
- Returns:
- See Also:
CapabilityService.getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
-
getCapabilityAccessState
public AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName)
Description copied from interface:CapabilityService
Helper method to get the access state for a single capability.- Specified by:
getCapabilityAccessState
in interfaceCapabilityService
- Returns:
- See Also:
CapabilityService.getCapabilityAccessState(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
-
getGroups
public List<Group> getGroups()
Description copied from interface:CapabilityService
Gets the list of all the capability groups (in index order)- Specified by:
getGroups
in interfaceCapabilityService
- Returns:
List
<Group
> List of all the capability groups (in index order)- See Also:
CapabilityService.getGroups()
-
getCapabilitiesByGroupId
public List<Capability> getCapabilitiesByGroupId(String groupId)
Description copied from interface:CapabilityService
Gets a list of capabilities for the given group id- Specified by:
getCapabilitiesByGroupId
in interfaceCapabilityService
- 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- See Also:
CapabilityService.getCapabilitiesByGroupId(java.lang.String)
-
getCapabilitiesByGroup
public List<Capability> getCapabilitiesByGroup(Group group)
Description copied from interface:CapabilityService
Get a list of capabilities for the given group- Specified by:
getCapabilitiesByGroup
in interfaceCapabilityService
- Parameters:
group
- The group for which the list of capabilities should be retrieved- Returns:
List
<Capability
> List of capabilities for the given group- See Also:
CapabilityService.getCapabilitiesByGroup(org.alfresco.module.org_alfresco_module_rm.capability.Group)
-
getGroup
public Group getGroup(String groupId)
Description copied from interface:CapabilityService
Gets a group from it's id- Specified by:
getGroup
in interfaceCapabilityService
- Parameters:
groupId
- The id of the group which should be retrieved- Returns:
- Group The group with the id groupId
- See Also:
CapabilityService.getGroup(java.lang.String)
-
addGroup
public void addGroup(Group group)
Description copied from interface:CapabilityService
Adds a group to the list of groups- Specified by:
addGroup
in interfaceCapabilityService
- Parameters:
group
- The group which should be added- See Also:
CapabilityService.addGroup(org.alfresco.module.org_alfresco_module_rm.capability.Group)
-
removeGroup
public void removeGroup(Group group)
Description copied from interface:CapabilityService
Removes a group from the list of groups- Specified by:
removeGroup
in interfaceCapabilityService
- Parameters:
group
- The group which should be removed- See Also:
CapabilityService.removeGroup(org.alfresco.module.org_alfresco_module_rm.capability.Group)
-
hasCapability
public boolean hasCapability(NodeRef nodeRef, String capabilityName)
Description copied from interface:CapabilityService
Check if the current user has the given capability.- Specified by:
hasCapability
in interfaceCapabilityService
- Returns:
- See Also:
CapabilityService.hasCapability(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
-
-