Interface ContentPermissionManager

    • 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 -
      • removeContentPermission

        void removeContentPermission​(ContentPermission permission)
      • removeAllGroupPermissions

        void removeAllGroupPermissions​(String groupName)
        Remove all content permission associated with a given group.
        Parameters:
        groupName -
      • removeAllUserPermissions

        void removeAllUserPermissions​(ConfluenceUser user)
        Remove all content permission associated with a given user.
        Parameters:
        user -
        Since:
        5.3
      • getPermittedChildren

        @Transactional(readOnly=true)
        List<Page> getPermittedChildren​(Page page,
                                        ConfluenceUser user)
        Returns a list of Page objects that are direct children of the passed in page. This method will only return the children the passed in user has permission to view.
        Since:
        8.8
      • getPermittedChildren

        @Transactional(readOnly=true)
        @Deprecated(forRemoval=true)
        default List<Page> getPermittedChildren​(Page page,
                                                com.atlassian.user.User user)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a list of Page objects that are direct children of the passed in page. This method will only return the children the passed in user has permission to view.
      • hasPermittedChildrenIgnoreInheritedPermissions

        boolean hasPermittedChildrenIgnoreInheritedPermissions​(Page page,
                                                               ConfluenceUser remoteUser)
        Does the given page have children visible to the given user. This method assumes that the given page is already visible to the given user and does not check the inherited permissions.
        Since:
        8.8
      • hasPermittedChildrenIgnoreInheritedPermissions

        @Deprecated(forRemoval=true)
        default boolean hasPermittedChildrenIgnoreInheritedPermissions​(Page page,
                                                                       com.atlassian.user.User remoteUser)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Does the given page have children visible to the given user. This method assumes that the given page is already visible to the given user and does not check the inherited permissions.
      • getPermittedChildrenIgnoreInheritedPermissions

        @Transactional(readOnly=true)
        List<Page> getPermittedChildrenIgnoreInheritedPermissions​(Page page,
                                                                  ConfluenceUser user)
        Gets the list of child pages under the given page that are visible to the given user. This method assumes that the given page is already visible to the given user and does not check the inherited permissions.
        Since:
        8.8
      • getPermittedChildrenIgnoreInheritedPermissions

        @Transactional(readOnly=true)
        @Deprecated(forRemoval=true)
        default List<Page> getPermittedChildrenIgnoreInheritedPermissions​(Page page,
                                                                          com.atlassian.user.User user)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Gets the list of child pages under the given page that are visible to the given user. This method assumes that the given page is already visible to the given user and does not check the inherited permissions.
        Since:
        5.10
      • getInheritedContentPermissionSets

        @Transactional(readOnly=true)
        List<ContentPermissionSet> getInheritedContentPermissionSets​(ContentEntityObject contentEntityObject,
                                                                     boolean includeEditPermissions)
        Get the inherited ContentPermissionSets that affect this ceo. Note that EDIT Permissions are not currently inherited, however edit permissions are treated as view permissions when considering inheritance, unless the boolean 'includeEditPermissions' is set to false.
        Parameters:
        contentEntityObject - whose permissions will be returned. Not null.
        includeEditPermissions - which specifies whether or not edit permissions should be additionally treated as view permissions.
        Returns:
        a list of ContentPermissionSets. Not null, but can be empty.
        Since:
        5.8
      • isPermissionInherited

        boolean isPermissionInherited​(Page childPage)
        Does the child page get its permissions from any ancestor?
        Parameters:
        childPage -
        Returns:
        boolean True if the child page does not have a view permission set, and an ancestor does.
      • getPermissionSets

        @Transactional(readOnly=true)
        Map<Long,​Boolean> getPermissionSets​(ConfluenceUser user,
                                                  Space space)
        Retrieves the configured permissions regarding whether the specified user can view the pages inside a space. If a page is not configured in the tables - CONTENT_PERM_SET and CONTENT_PERM, then the permission of that page will not be included here. Note: the permission returned here does not consider the inherited permission from parent page.
        Parameters:
        user - - confluence user to be checked
        space - - confluence space
        Returns:
        a Map where the key is the page id and the value indicates the view permission.
        Since:
        8.8
      • getPermissionSets

        @Transactional(readOnly=true)
        @Deprecated(forRemoval=true)
        default Map<Long,​Boolean> getPermissionSets​(com.atlassian.user.User user,
                                                          Space space)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Retrieves the configured permissions regarding whether the specified user can view the pages inside a space. If a page is not configured in the tables - CONTENT_PERM_SET and CONTENT_PERM, then the permission of that page will not be included here. Note: the permission returned here does not consider the inherited permission from parent page.
        Parameters:
        user - - confluence user to be checked
        space - - confluence space
        Returns:
        a Map where the key is the page id and the value indicates the view permission.
        Since:
        5.10.8