Class LabelPermissionEnforcerImpl
- java.lang.Object
-
- com.atlassian.confluence.impl.labels.LabelPermissionEnforcerImpl
-
- All Implemented Interfaces:
LabelPermissionEnforcer
public class LabelPermissionEnforcerImpl extends Object implements LabelPermissionEnforcer
Performs permission checking for label editing actions- Since:
- 6.9.0
-
-
Constructor Summary
Constructors Constructor Description LabelPermissionEnforcerImpl(PermissionManager permissionManager, AccessModeService accessModeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List
filterLabelsByNamespace(List labelList, @Nullable com.atlassian.user.User user, Namespace namespace)
Takes a list of label objects and filters out those not in the specified namespaceList
filterVisibleLabels(List labelList, @Nullable com.atlassian.user.User user, boolean hideSpecialLabels)
Takes a list of label objects and filters out those not visible to the given userboolean
isLabelableByUser(Labelable object)
Checks that the object permits labels to be edited by the logged in user.boolean
userCanEditLabel(Label label, Labelable object)
Check if the user can edit a label of an objectboolean
userCanEditLabel(ParsedLabelName ref, Labelable object)
Check if the user can edit a label of an objectboolean
userCanEditLabelOrIsSpaceAdmin(Label label, SpaceContentEntityObject object)
Check if the user can edit a label of a space object or a space adminboolean
userCanViewObject(Labelable object)
Check if the user can view the labelable object
-
-
-
Constructor Detail
-
LabelPermissionEnforcerImpl
public LabelPermissionEnforcerImpl(PermissionManager permissionManager, AccessModeService accessModeService)
-
-
Method Detail
-
isLabelableByUser
public boolean isLabelableByUser(Labelable object)
Description copied from interface:LabelPermissionEnforcer
Checks that the object permits labels to be edited by the logged in user.- Specified by:
isLabelableByUser
in interfaceLabelPermissionEnforcer
- Parameters:
object
- - the object to be labelled, if null returns false.- Returns:
- true if permitted.
-
userCanEditLabel
public boolean userCanEditLabel(ParsedLabelName ref, Labelable object)
Description copied from interface:LabelPermissionEnforcer
Check if the user can edit a label of an object- Specified by:
userCanEditLabel
in interfaceLabelPermissionEnforcer
- Parameters:
ref
- the referen ce to the labelobject
- the object associated with the label- Returns:
- true if permitted
-
userCanEditLabel
public boolean userCanEditLabel(Label label, Labelable object)
Description copied from interface:LabelPermissionEnforcer
Check if the user can edit a label of an object- Specified by:
userCanEditLabel
in interfaceLabelPermissionEnforcer
- Parameters:
label
- the labelobject
- the object associated with the label- Returns:
- true if permitted
-
userCanEditLabelOrIsSpaceAdmin
public boolean userCanEditLabelOrIsSpaceAdmin(Label label, SpaceContentEntityObject object)
Description copied from interface:LabelPermissionEnforcer
Check if the user can edit a label of a space object or a space admin- Specified by:
userCanEditLabelOrIsSpaceAdmin
in interfaceLabelPermissionEnforcer
- Parameters:
label
- the labelobject
- the space object- Returns:
- true if permitted
-
userCanViewObject
public boolean userCanViewObject(Labelable object)
Description copied from interface:LabelPermissionEnforcer
Check if the user can view the labelable object- Specified by:
userCanViewObject
in interfaceLabelPermissionEnforcer
- Parameters:
object
- the labelable object- Returns:
- true if permitted
-
filterVisibleLabels
public List filterVisibleLabels(List labelList, @Nullable com.atlassian.user.User user, boolean hideSpecialLabels)
Description copied from interface:LabelPermissionEnforcer
Takes a list of label objects and filters out those not visible to the given user- Specified by:
filterVisibleLabels
in interfaceLabelPermissionEnforcer
- Parameters:
labelList
- a list of Label objectsuser
- the User the labels are filtered forhideSpecialLabels
- whether to hide special labels, such as favourites- Returns:
- a filtered list of Label objects
-
filterLabelsByNamespace
public List filterLabelsByNamespace(List labelList, @Nullable com.atlassian.user.User user, Namespace namespace)
Description copied from interface:LabelPermissionEnforcer
Takes a list of label objects and filters out those not in the specified namespace- Specified by:
filterLabelsByNamespace
in interfaceLabelPermissionEnforcer
- Parameters:
labelList
- a list of Label objectsuser
- the User the labels are filtered fornamespace
- the Namespace to filter by- Returns:
- a filtered list of Label objects
-
-