Class DenormalisedContentViewPermissionDao
java.lang.Object
com.atlassian.confluence.security.denormalisedpermissions.impl.content.dao.DenormalisedContentViewPermissionDao
Dao for working with denormalised content view permissions.
- Since:
- 7.11.0
-
Constructor Summary
ConstructorsConstructorDescriptionDenormalisedContentViewPermissionDao
(org.hibernate.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(DenormalisedContentViewPermission denormalisedContentViewPermission) Adds a new record.void
add
(List<DenormalisedContentViewPermission> permissionsToAdd) Adds a list of records.getAllExistingSidsForPages
(Collection<Long> pageIdList) Finds all sids having access to content pages.getAllVisibleChildren
(Collection<Long> parentIds, Collection<Long> sidIdList, boolean permissionExempt) Returns all visible children for the provided set of parent idsgetAllVisibleTopLevelPages
(long spaceId, Set<Long> sids, boolean permissionExempt) Return all visible top-level pages.getDenormalisedContentList
(Set<Long> pageIdSet) Returns a list of simple content pages.getSimpleContentIdsInRange
(Long fromId, Long toId) getVisiblePages
(Set<Long> sids, Set<Long> pageIds) Returns only visible pages from the provided page id list.getVisiblePagesFromSpace
(long spaceId, Collection<Long> sidIdList, boolean permissionExempt) Returns all visible pages from space.void
removeAllDenormalisedRecordsForPages
(Set<Long> pageIdsToRemove) void
removeAllSimpleContentRecordsForPages
(Set<Long> pageIdsToRemove) void
removeRecords
(Long pageId, Set<Long> sidIds) Removes records from denormalised view permissions table.void
saveSimpleContent
(SimpleContent simpleContent)
-
Constructor Details
-
DenormalisedContentViewPermissionDao
public DenormalisedContentViewPermissionDao(org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
getSimpleContentIdsInRange
-
getAllExistingSidsForPages
Finds all sids having access to content pages. For better performance, it accepts a bunch of page ids and retrieves data in one request.- Parameters:
pageIdList
- - set of page ids.- Returns:
- map where key is the page id and the value is a set of sids having access to the required pages.
-
removeRecords
Removes records from denormalised view permissions table.- Parameters:
pageId
- page idsidIds
- set of sids to remove
-
removeAllDenormalisedRecordsForPages
-
removeAllSimpleContentRecordsForPages
-
add
Adds a new record.- Parameters:
denormalisedContentViewPermission
- record to add
-
add
Adds a list of records.- Parameters:
permissionsToAdd
- list of records.
-
getVisiblePagesFromSpace
public List<SimpleContent> getVisiblePagesFromSpace(long spaceId, Collection<Long> sidIdList, boolean permissionExempt) Returns all visible pages from space. Note that pages do not take into account parent permissions.- Parameters:
spaceId
- space idsidIdList
- sid idspermissionExempt
-- Returns:
- list of simple pages
-
getAllVisibleChildren
public Map<Long,List<SimpleContent>> getAllVisibleChildren(Collection<Long> parentIds, Collection<Long> sidIdList, boolean permissionExempt) Returns all visible children for the provided set of parent ids- Parameters:
parentIds
- parent idssidIdList
- sid idspermissionExempt
-- Returns:
- map where parent
-
getAllVisibleTopLevelPages
public List<SimpleContent> getAllVisibleTopLevelPages(long spaceId, Set<Long> sids, boolean permissionExempt) Return all visible top-level pages.- Parameters:
spaceId
- space idsids
- sid idspermissionExempt
- if true, permissions should not be checked- Returns:
- visible top level pages
-
getDenormalisedContentList
Returns a list of simple content pages. -
saveSimpleContent
-
getVisiblePages
Returns only visible pages from the provided page id list. It checks inherited permissions, but does not check space permissions. The idea is to get find all pages first and exclude not-visible pages (by checking only direct permissions). Then get their parents and check their direct permissions too. Kick out those pages whose parents are invisible. Repeat until we reach top-level ancestors for all the pages. At this moment we will have visible pages.- Parameters:
sids
- sids sidspageIds
- page ids pages ids to check- Returns:
- visible page ids
- Since:
- 7.12.0
-