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 getInheritedContentPermissions(ContentEntityObject contentEntityObject)
          Deprecated. use #getInheritedContentPermissionSets
 List getInheritedContentPermissionSets(ContentEntityObject contentEntityObject)
           
 List getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)
           
 List getInheritedViewContentPermissions(Page page)
          only get inherited permissions that are restrict the viewing of pages
 List getPermittedChildren(Page page, com.atlassian.user.User user)
           
 Set 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 removeContentPermission(ContentPermission permission)
           
 void setContentPermissions(List contentPermissions, ContentEntityObject content, String type)
          Set the Content Permissions on the CEO to be the list of ContentPermissions passed.
 

Method Detail

addContentPermission

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.

Parameters:
permission -
content -

setContentPermissions

public void setContentPermissions(List 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 - list of ContentPermissions
content -
type -

removeContentPermission

public void removeContentPermission(ContentPermission permission)

getInheritedContentPermissions

public 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

public List getInheritedContentUserPermissions(ContentEntityObject contentEntityObject)

getInheritedContentPermissionSets

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

hasContentLevelPermission

public 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

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

getInheritedViewContentPermissions

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

Parameters:
page -
Returns:
a list of ContentPermission instances

getViewContentPermissions

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

Parameters:
page -
Returns:
a list of ContentPermission instances


Confluence is developed by Atlassian.