Class ContentPermissionSet
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.security.ContentPermissionSet
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<ContentPermission>
- Direct Known Subclasses:
NeverPermittedContentPermissionSet
public class ContentPermissionSet
extends com.atlassian.core.bean.EntityObject
implements Iterable<ContentPermission>, Serializable
This is a container for
ContentPermission
s linked to some ContentEntityObject
. Each ContentEntityObject
has a list of ContentPermissionSet
s. One per operation type.
E.g. one ContentPermissionSet
containing VIEW ContentPermission
s, another one for EDIT, etc...
Each ContentPermissionSet
has as many ContentPermission
s as there are specific users and/or groups to whom corresponding operations are restricted.- See Also:
-
ContentEntityObject.contentPermissionSets
ContentPermission
ContentRestriction
ContentRestrictionFactory
- Serialized Form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContentPermission
(ContentPermission contentPermission) boolean
contains
(ContentPermission contentPermission) boolean
containsAll
(ContentPermissionSet permissionSet) Retrieve a copy of the content permissions.getAllExcept
(Collection<ContentPermission> exclusions) Retrieve all theContentPermission
s in this set that do not exist in the given collection.com.google.common.collect.ImmutableCollection<ContentPermission>
Deprecated.since 7.0.1.Returns the names of all groups in this Content Permission Set as a list ofString
s.getType()
List<com.atlassian.sal.api.user.UserKey>
Returns the names of all users in this Content Permission Set as a list ofString
s.Deprecated.since 5.3 Use {@link #getUserKeys)}boolean
isEmpty()
boolean
isPermitted
(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useContentPermissionManager
iterator()
void
removeContentPermission
(ContentPermission contentPermission) Remove the given content permission from this set.void
setOwningContent
(ContentEntityObject owningContent) Hibernate setter.void
int
size()
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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ContentPermissionSet
public ContentPermissionSet() -
ContentPermissionSet
-
-
Method Details
-
addContentPermission
-
removeContentPermission
Remove the given content permission from this set. Does nothing if the permission is not in the set. -
isPermitted
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useContentPermissionManager
- Returns:
- true this user passes at least one of the permissions in this set
-
getType
-
setType
-
isEmpty
public boolean isEmpty() -
size
public int size() -
contains
-
containsAll
-
getOwningContent
-
setOwningContent
Hibernate setter. -
iterator
- Specified by:
iterator
in interfaceIterable<ContentPermission>
- Returns:
- an unmodifiable iterator over the
ContentPermission
s in the set.
-
getGroupNames
Returns the names of all groups in this Content Permission Set as a list ofString
s.- Returns:
- the names of all groups in this Content Permission Set as a list of
String
s.
-
getUserNames
Deprecated.since 5.3 Use {@link #getUserKeys)}Returns the names of all users in this Content Permission Set as a list ofString
s. -
getUserKeys
Returns the names of all users in this Content Permission Set as a list ofString
s. -
getAllExcept
Retrieve all theContentPermission
s in this set that do not exist in the given collection. The comparison is done according toComparable.compareTo(Object)
.- Parameters:
exclusions
- a collection ofContentPermission
s- Returns:
- the
ContentPermission
s that are in this object and not given collection.
-
getContentPermissionsCopy
@Deprecated public com.google.common.collect.ImmutableCollection<ContentPermission> getContentPermissionsCopy()Deprecated.since 7.0.1. UsecontentPermissionsCopy()
Retrieve a copy of the content permissions. We create a copy of the contentPermissions to prevent the original collection from being modified.- Returns:
- A copy of the contentPermissions
- Since:
- 5.9.2
-
contentPermissionsCopy
Retrieve a copy of the content permissions. We create a copy of the contentPermissions to prevent the original collection from being modified.- Returns:
- A copy of the contentPermissions
- Since:
- 7.0.1
-
toString
-