public class LabelPermissionSupport extends Object
Constructor and Description |
---|
LabelPermissionSupport() |
Modifier and Type | Method and Description |
---|---|
static List |
filterLabelsByNamespace(List labelList,
com.atlassian.user.User user,
Namespace namespace)
Takes a list of label objects and filters out those not in the specified namespace
|
static List |
filterVisibleLabels(List labelList,
com.atlassian.user.User user,
boolean hideSpecialLables)
Takes a list of label objects and filters out those not visible to the given user
|
static boolean |
isLabelableByUser(Labelable object,
PermissionManager permissionManager)
Checks that the object permits labels to be edited by the logged in user.
|
static boolean |
userCanEditLabel(Label label,
Labelable object,
PermissionManager permissionManager) |
static boolean |
userCanEditLabel(ParsedLabelName ref,
Labelable object,
PermissionManager permissionManager) |
static boolean |
userCanEditLabelOrIsSpaceAdmin(Label label,
SpaceContentEntityObject object,
PermissionManager permissionManager) |
static boolean |
userCanViewObject(Labelable object,
PermissionManager permissionManager) |
public static boolean isLabelableByUser(Labelable object, PermissionManager permissionManager)
object
- - the object to be labelled, if null returns false.permissionManager
- - permission manaager to usepublic static boolean userCanEditLabel(ParsedLabelName ref, Labelable object, PermissionManager permissionManager)
public static boolean userCanEditLabel(Label label, Labelable object, PermissionManager permissionManager)
public static boolean userCanEditLabelOrIsSpaceAdmin(Label label, SpaceContentEntityObject object, PermissionManager permissionManager)
public static boolean userCanViewObject(Labelable object, PermissionManager permissionManager)
public static List filterVisibleLabels(List labelList, com.atlassian.user.User user, boolean hideSpecialLables)
labelList
- a list of Label objectsuser
- the User the labels are filtered forhideSpecialLables
- whether to hide special labels, such as favouritespublic static List filterLabelsByNamespace(List labelList, com.atlassian.user.User user, Namespace namespace)
labelList
- a list of Label objectsuser
- the User the labels are filtered fornamespace
- the Namespace to filter byCopyright © 2003–2017 Atlassian. All rights reserved.