com.atlassian.confluence.security
Class ContentPermissionSet

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.security.ContentPermissionSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<ContentPermission>

public class ContentPermissionSet
extends com.atlassian.core.bean.EntityObject
implements java.lang.Iterable<ContentPermission>, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
ContentPermissionSet()
           
ContentPermissionSet(java.lang.String type, ContentEntityObject owningContent)
           
 
Method Summary
 void addContentPermission(ContentPermission contentPermission)
           
 boolean contains(ContentPermission contentPermission)
           
 boolean containsAll(ContentPermissionSet permissionSet)
           
 java.util.Collection<ContentPermission> getAllExcept(java.util.Collection<ContentPermission> exclusions)
          Retrieve all the ContentPermissions in this set that do not exist in the given collection.
 java.util.List<java.lang.String> getGroupNames()
          Returns the names of all groups in this Content Permission Set as a list of Strings.
 ContentEntityObject getOwningContent()
           
 java.lang.String getType()
           
 java.util.List<com.atlassian.sal.api.user.UserKey> getUserKeys()
          Returns the names of all users in this Content Permission Set as a list of Strings.
 java.util.List<java.lang.String> getUserNames()
          Deprecated. since 5.3 Use #getUserKeys)
 boolean isEmpty()
           
 boolean isPermitted(com.atlassian.user.User user)
           
 java.util.Iterator<ContentPermission> iterator()
           
 void removeContentPermission(ContentPermission contentPermission)
          Remove the given content permission from this set.
 void setOwningContent(ContentEntityObject owningContent)
          Hibernate setter.
 void setType(java.lang.String type)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, equals, getCreationDate, getCurrentDate, getId, getLastModificationDate, hashCode, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentPermissionSet

public ContentPermissionSet()

ContentPermissionSet

public ContentPermissionSet(java.lang.String type,
                            ContentEntityObject owningContent)
Method Detail

addContentPermission

public void addContentPermission(ContentPermission contentPermission)

removeContentPermission

public void removeContentPermission(ContentPermission contentPermission)
Remove the given content permission from this set. Does nothing if the permission is not in the set.


isPermitted

public boolean isPermitted(com.atlassian.user.User user)
Returns:
true this user passes at least one of the permissions in this set

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

isEmpty

public boolean isEmpty()

size

public int size()

contains

public boolean contains(ContentPermission contentPermission)

containsAll

public boolean containsAll(ContentPermissionSet permissionSet)

getOwningContent

public ContentEntityObject getOwningContent()

setOwningContent

public void setOwningContent(ContentEntityObject owningContent)
Hibernate setter.


iterator

public java.util.Iterator<ContentPermission> iterator()
Specified by:
iterator in interface java.lang.Iterable<ContentPermission>
Returns:
an unmodifiable iterator over the ContentPermissions in the set.

getGroupNames

public java.util.List<java.lang.String> getGroupNames()
Returns the names of all groups in this Content Permission Set as a list of Strings.

Returns:
the names of all groups in this Content Permission Set as a list of Strings.

getUserNames

@Deprecated
public java.util.List<java.lang.String> getUserNames()
Deprecated. since 5.3 Use #getUserKeys)

Returns the names of all users in this Content Permission Set as a list of Strings.


getUserKeys

public java.util.List<com.atlassian.sal.api.user.UserKey> getUserKeys()
Returns the names of all users in this Content Permission Set as a list of Strings.


getAllExcept

public java.util.Collection<ContentPermission> getAllExcept(java.util.Collection<ContentPermission> exclusions)
Retrieve all the ContentPermissions in this set that do not exist in the given collection. The comparison is done according to Comparable.compareTo(Object).

Parameters:
exclusions - a collection of ContentPermissions
Returns:
the ContentPermissions that are in this object and not given collection.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2014 Atlassian. All Rights Reserved.