com.atlassian.confluence.labels
Class LabelPermissionSupport

java.lang.Object
  extended by com.atlassian.confluence.labels.LabelPermissionSupport

public class LabelPermissionSupport
extends java.lang.Object


Constructor Summary
LabelPermissionSupport()
           
 
Method Summary
static java.util.List filterLabelsByNamespace(java.util.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 java.util.List filterVisibleLabels(java.util.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 userCanEditLabel(Label label, Labelable object, PermissionManager permissionManager)
           
static boolean userCanEditLabel(ParsedLabelName ref, Labelable object, PermissionManager permissionManager)
           
static boolean userCanEditLabels(Labelable object, PermissionManager permissionManager)
           
static boolean userCanViewObject(Labelable object, PermissionManager permissionManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelPermissionSupport

public LabelPermissionSupport()
Method Detail

userCanEditLabels

public static boolean userCanEditLabels(Labelable object,
                                        PermissionManager permissionManager)

userCanEditLabel

public static boolean userCanEditLabel(ParsedLabelName ref,
                                       Labelable object,
                                       PermissionManager permissionManager)

userCanEditLabel

public static boolean userCanEditLabel(Label label,
                                       Labelable object,
                                       PermissionManager permissionManager)

userCanViewObject

public static boolean userCanViewObject(Labelable object,
                                        PermissionManager permissionManager)

filterVisibleLabels

public static java.util.List filterVisibleLabels(java.util.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

Parameters:
labelList - a list of Label objects
user - the User the labels are filtered for
hideSpecialLables - whether to hide special labels, such as favourites
Returns:
a filtered list of Label objects

filterLabelsByNamespace

public static java.util.List filterLabelsByNamespace(java.util.List labelList,
                                                     com.atlassian.user.User user,
                                                     Namespace namespace)
Takes a list of label objects and filters out those not in the specified namespace

Parameters:
labelList - a list of Label objects
user - the User the labels are filtered for
namespace - the Namespace to filter by
Returns:
a filtered list of Label objects


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.