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.
 java.util.List getContentPermissionSets(ContentEntityObject ceo, java.lang.String type)
          Get the ContentPermissionSets that affect this ceo, both inherited and directly.
 java.util.List getInheritedContentPermissions(ContentEntityObject contentEntityObject)
          Deprecated. use #getInheritedContentPermissionSets
 java.util.List getInheritedContentPermissionSets(ContentEntityObject contentEntityObject)
           
 java.util.List getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)
           
 java.util.List getInheritedViewContentPermissions(Page page)
          only get inherited permissions that are restrict the viewing of pages
 java.util.List<Page> getPermittedChildren(Page page, com.atlassian.user.User user)
           
 java.util.Set getViewContentPermissions(Page page)
          Get view permissions on this page and its ancestors.
 boolean hasContentLevelPermission(com.atlassian.user.User user, java.lang.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(java.lang.String groupName)
          Remove all content permission associtated with a given group.
 void removeAllUserPermissions(java.lang.String username)
          Remove all content permission associtated with a given user.
 void removeContentPermission(ContentPermission permission)
           
 void setContentPermissions(java.util.Collection contentPermissions, ContentEntityObject content, java.lang.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(java.util.Collection contentPermissions,
                           ContentEntityObject content,
                           java.lang.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(java.lang.String groupName)
Remove all content permission associtated with a given group.

Parameters:
groupName -

removeAllUserPermissions

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

Parameters:
username -

getInheritedContentPermissions

java.util.List 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

java.util.List getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)

getInheritedContentPermissionSets

java.util.List 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,
                                  java.lang.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

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

getInheritedViewContentPermissions

java.util.List getInheritedViewContentPermissions(Page page)
only get inherited permissions that are restrict the viewing of pages

Parameters:
page -
Returns:
a list of ContentPermission instances

getViewContentPermissions

java.util.Set getViewContentPermissions(Page page)
Get view permissions on this page and its ancestors.

Parameters:
page -
Returns:
a list of ContentPermission instances

getContentPermissionSets

java.util.List getContentPermissionSets(ContentEntityObject ceo,
                                        java.lang.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-2008 Atlassian Pty Ltd. All Rights Reserved.