public class LabelPermissionEnforcerImpl extends Object implements LabelPermissionEnforcer
Constructor and Description |
---|
LabelPermissionEnforcerImpl(PermissionManager permissionManager,
AccessModeService accessModeService) |
Modifier and Type | Method and 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 namespace
|
List |
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 user
|
boolean |
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 object
|
boolean |
userCanEditLabel(ParsedLabelName ref,
Labelable object)
Check if the user can edit a label of an object
|
boolean |
userCanEditLabelOrIsSpaceAdmin(Label label,
SpaceContentEntityObject object)
Check if the user can edit a label of a space object or a space admin
|
boolean |
userCanViewObject(Labelable object)
Check if the user can view the labelable object
|
public LabelPermissionEnforcerImpl(PermissionManager permissionManager, AccessModeService accessModeService)
public boolean isLabelableByUser(Labelable object)
LabelPermissionEnforcer
isLabelableByUser
in interface LabelPermissionEnforcer
object
- - the object to be labelled, if null returns false.public boolean userCanEditLabel(ParsedLabelName ref, Labelable object)
LabelPermissionEnforcer
userCanEditLabel
in interface LabelPermissionEnforcer
ref
- the referen ce to the labelobject
- the object associated with the labelpublic boolean userCanEditLabel(Label label, Labelable object)
LabelPermissionEnforcer
userCanEditLabel
in interface LabelPermissionEnforcer
label
- the labelobject
- the object associated with the labelpublic boolean userCanEditLabelOrIsSpaceAdmin(Label label, SpaceContentEntityObject object)
LabelPermissionEnforcer
userCanEditLabelOrIsSpaceAdmin
in interface LabelPermissionEnforcer
label
- the labelobject
- the space objectpublic boolean userCanViewObject(Labelable object)
LabelPermissionEnforcer
userCanViewObject
in interface LabelPermissionEnforcer
object
- the labelable objectpublic List filterVisibleLabels(List labelList, @Nullable com.atlassian.user.User user, boolean hideSpecialLabels)
LabelPermissionEnforcer
filterVisibleLabels
in interface LabelPermissionEnforcer
labelList
- a list of Label objectsuser
- the User the labels are filtered forhideSpecialLabels
- whether to hide special labels, such as favouritespublic List filterLabelsByNamespace(List labelList, @Nullable com.atlassian.user.User user, Namespace namespace)
LabelPermissionEnforcer
filterLabelsByNamespace
in interface LabelPermissionEnforcer
labelList
- a list of Label objectsuser
- the User the labels are filtered fornamespace
- the Namespace to filter byCopyright © 2003–2021 Atlassian. All rights reserved.