com.atlassian.confluence.core
Interface ContentPermissionManager

All Known Implementing Classes:
DefaultContentPermissionManager

public interface ContentPermissionManager


Method Summary
 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<ContentPermission> getInheritedContentPermissions(ContentEntityObject contentEntityObject)
          Deprecated. use #getInheritedContentPermissionSets
 List<ContentPermissionSet> getInheritedContentPermissionSets(ContentEntityObject contentEntityObject)
           
 List<ContentPermission> getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)
           
 List<Page> getPermittedChildren(Page page, com.atlassian.user.User user)
           
 Set<ContentPermission> getViewContentPermissions(Page page)
          Get view permissions on this page and its ancestors.
 boolean hasContentLevelPermission(com.atlassian.user.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.
 

Method Detail

addContentPermission

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.

Parameters:
permission -
content -

setContentPermissions

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
content -
type -

removeContentPermission

void removeContentPermission(ContentPermission permission)

removeAllGroupPermissions

void removeAllGroupPermissions(String groupName)
Remove all content permission associtated with a given group.

Parameters:
groupName -

removeAllUserPermissions

void removeAllUserPermissions(String username)
Remove all content permission associtated with a given user.

Parameters:
username -

getInheritedContentPermissions

List<ContentPermission> getInheritedContentPermissions(ContentEntityObject contentEntityObject)
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.


getInheritedContentUserPermissions

List<ContentPermission> getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)

getInheritedContentPermissionSets

List<ContentPermissionSet> getInheritedContentPermissionSets(ContentEntityObject contentEntityObject)
Returns:
a list of ContentPermissionSets of type ContentPermission.VIEW_PERMISSION of all ancestors of contentEntityObject

hasContentLevelPermission

boolean hasContentLevelPermission(com.atlassian.user.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 - ContentPermission.VIEW_PERMISSION or ContentPermission.EDIT_PERMISSION
Returns:
true if the user has the specified type of permission on the given content

getPermittedChildren

List<Page> getPermittedChildren(Page page,
                                com.atlassian.user.User user)

getViewContentPermissions

Set<ContentPermission> getViewContentPermissions(Page page)
Get view permissions on this page and its ancestors.

Parameters:
page -
Returns:
a list of ContentPermission instances

getContentPermissionSets

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 ContentPermission.VIEW_PERMISSION or ContentPermission.EDIT_PERMISSION
Returns:
a list of ContentPermissionSets. Not null, but can be empty.


Copyright © 2003-2011 Atlassian. All Rights Reserved.