public interface

ContentPermissionManager

com.atlassian.confluence.core.ContentPermissionManager
Known Indirect Subclasses

Summary

Public Methods
void addContentPermission(ContentPermission permission, ContentEntityObject content)
Add permissions to the content entity objecct through the manager.
List<ContentPermissionSet> getContentPermissionSets(ContentEntityObject ceo, String type)
Get the ContentPermissionSets that affect this ceo, both inherited and directly.
List<ContentPermissionSet> getInheritedContentPermissionSets(ContentEntityObject contentEntityObject)
@Deprecated List<ContentPermission> getInheritedContentPermissions(ContentEntityObject contentEntityObject)
This method is deprecated. use #getInheritedContentPermissionSets
List<ContentPermission> getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)
List<Page> getPermittedChildren(Page page, User user)
Set<ContentPermission> getViewContentPermissions(Page page)
Get view permissions on this page and its ancestors.
boolean hasContentLevelPermission(User user, String permissionType, ContentEntityObject content)
fetches the inherited and explicit content level permissions for this content object and determines whether the user has access.
void removeAllGroupPermissions(String groupName)
Remove all content permission associtated with a given group.
void removeAllUserPermissions(String username)
Remove all content permission associtated with a given user.
void removeContentPermission(ContentPermission permission)
void setContentPermissions(Collection<ContentPermission> contentPermissions, ContentEntityObject content, String type)
Set the Content Permissions on the CEO to be the list of ContentPermissions passed.

Public Methods

public void addContentPermission (ContentPermission permission, ContentEntityObject content)

Add permissions to the content entity objecct through the manager. This will ensure that already existing permissions are updated and that the content will be reindexed.

public List<ContentPermissionSet> getContentPermissionSets (ContentEntityObject ceo, String type)

Get the ContentPermissionSets that affect this ceo, both inherited and directly. Note that EDIT Permissions are not currently inherited, so calling this method with EDIT will return only the direct ContentPermissionSet.

Parameters
ceo whose permissions will be returned. Not null.
type one of VIEW_PERMISSION or EDIT_PERMISSION
Returns

public List<ContentPermissionSet> getInheritedContentPermissionSets (ContentEntityObject contentEntityObject)

Returns

@Deprecated public List<ContentPermission> getInheritedContentPermissions (ContentEntityObject contentEntityObject)

This method is deprecated.
use #getInheritedContentPermissionSets

Returns all inherited content permission objects attached to the ancestors of this entity object, that is, all view permissions but *not* edit permissions.

public List<ContentPermission> getInheritedContentUserPermissions (ContentEntityObject contentEntityObject)

public List<Page> getPermittedChildren (Page page, User user)

public Set<ContentPermission> getViewContentPermissions (Page page)

Get view permissions on this page and its ancestors.

Returns
  • a list of ContentPermission instances

public boolean hasContentLevelPermission (User user, String permissionType, ContentEntityObject content)

fetches the inherited and explicit content level permissions for this content object and determines whether the user has access.

Parameters
permissionType VIEW_PERMISSION or EDIT_PERMISSION
Returns
  • true if the user has the specified type of permission on the given content

public void removeAllGroupPermissions (String groupName)

Remove all content permission associtated with a given group.

public void removeAllUserPermissions (String username)

Remove all content permission associtated with a given user.

public void removeContentPermission (ContentPermission permission)

public void setContentPermissions (Collection<ContentPermission> contentPermissions, ContentEntityObject content, String type)

Set the Content Permissions on the CEO to be the list of ContentPermissions passed. Passing an empty list removes all permissions. Passing a list containing just the existing permissions does nothing.

Parameters
contentPermissions set of ContentPermissions