Class HibernateSpacePermissionDao
java.lang.Object
org.springframework.dao.support.DaoSupport
com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao<SpacePermission>
com.atlassian.confluence.security.persistence.dao.hibernate.HibernateSpacePermissionDao
- All Implemented Interfaces:
SpacePermissionDao
,org.springframework.beans.factory.InitializingBean
public class HibernateSpacePermissionDao
extends ConfluenceHibernateObjectDao<SpacePermission>
implements SpacePermissionDao
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetreives all global permissionsfindAllGlobalPermissionsForType
(String permissionType) Retrieves all global permissions of type permissionTypefindGlobalGroupPermissions
(String permissionType) Find all global group permissions of typepermissionType
.findGroupPermissionsForSpace
(Space space, String permissionType) Find all group permissions of typepermissionType
forspace
.findPermissionsForGroup
(String group) Retrieves all permissions for groupfindPermissionsForSpace
(Space space) Retrieves all permissions for spacefindPermissionsForSpacesAndTypes
(Set<Long> spaceIdList, Collection<String> typeList) Retrieves all permissions for the provides space list.Retrieves all permissions for userfindPermissionTypes
(SpacePermission permission) Find all permission types matching the combination of (space, user, group, authenticated access subject) in permission.getById
(long id) Retrieves a single SpacePermission by its IDboolean
hasPermission
(SpacePermission permission) Determines whether permission exists in the data storevoid
remove
(SpacePermission spacePermission) Remove an object from the databasevoid
removePermissionsForGroup
(String group) void
removePermissionsForSpace
(Space space) Removes all permissions in spacevoid
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao
updateModificationData
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, getHibernateTemplate, getSessionFactory, publishEvent, reIndex, save, saveEntity, saveRaw, setHibernateTemplate, setSessionFactory, uniqueResult
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.security.persistence.dao.SpacePermissionDao
save
-
Constructor Details
-
HibernateSpacePermissionDao
public HibernateSpacePermissionDao()
-
-
Method Details
-
getPersistentClass
- Specified by:
getPersistentClass
in classHibernateObjectDao<SpacePermission>
-
getById
Description copied from interface:SpacePermissionDao
Retrieves a single SpacePermission by its ID- Specified by:
getById
in interfaceSpacePermissionDao
- Parameters:
id
- the SpacePermission to retrieve- Returns:
- a SpacePermission object, or null if it could not be found
-
hasPermission
Description copied from interface:SpacePermissionDao
Determines whether permission exists in the data store- Specified by:
hasPermission
in interfaceSpacePermissionDao
- Parameters:
permission
- the SpacePermission to look up- Returns:
- true if it exists, false otherwise
-
findAllGlobalPermissions
Description copied from interface:SpacePermissionDao
Retreives all global permissions- Specified by:
findAllGlobalPermissions
in interfaceSpacePermissionDao
- Returns:
- a List of matching SpacePermission objects
-
findAllGlobalPermissionsForType
Description copied from interface:SpacePermissionDao
Retrieves all global permissions of type permissionType- Specified by:
findAllGlobalPermissionsForType
in interfaceSpacePermissionDao
- Parameters:
permissionType
- the SpacePermission type to look up- Returns:
- a List of matching SpacePermission objects
-
findPermissionsForGroup
Description copied from interface:SpacePermissionDao
Retrieves all permissions for group- Specified by:
findPermissionsForGroup
in interfaceSpacePermissionDao
- Parameters:
group
- the group to look up- Returns:
- a List of SpacePermission objects
-
findPermissionsForSpace
Description copied from interface:SpacePermissionDao
Retrieves all permissions for space- Specified by:
findPermissionsForSpace
in interfaceSpacePermissionDao
- Parameters:
space
- the Space to look up- Returns:
- a List of SpacePermission objects
-
findPermissionsForSpacesAndTypes
public List<SpacePermissionDTOLight> findPermissionsForSpacesAndTypes(Set<Long> spaceIdList, Collection<String> typeList) Retrieves all permissions for the provides space list. This method was introduced to avoid joins spaces (Hibernates joins Space table by default).- Specified by:
findPermissionsForSpacesAndTypes
in interfaceSpacePermissionDao
- Parameters:
spaceIdList
- list of space idtypeList
- list of permission types to retrive- Returns:
- a list light space permission object
- Since:
- 7.10.0
-
findGroupPermissionsForSpace
Description copied from interface:SpacePermissionDao
Find all group permissions of typepermissionType
forspace
.- Specified by:
findGroupPermissionsForSpace
in interfaceSpacePermissionDao
permissionType
- one of the constants inSpacePermission
, such asSpacePermission.VIEWSPACE_PERMISSION
.- Returns:
- a non-null collection of permissions
-
findGlobalGroupPermissions
Description copied from interface:SpacePermissionDao
Find all global group permissions of typepermissionType
.- Specified by:
findGlobalGroupPermissions
in interfaceSpacePermissionDao
- Parameters:
permissionType
- one of the constants inSpacePermission
, such asSpacePermission.USE_CONFLUENCE_PERMISSION
.- Returns:
- a non-null collection of permissions
-
remove
Description copied from class:HibernateObjectDao
Remove an object from the database- Specified by:
remove
in interfaceSpacePermissionDao
- Overrides:
remove
in classHibernateObjectDao<SpacePermission>
- Parameters:
spacePermission
- the object to remove
-
findPermissionsForUser
Description copied from interface:SpacePermissionDao
Retrieves all permissions for user- Specified by:
findPermissionsForUser
in interfaceSpacePermissionDao
- Parameters:
user
- the user to look up- Returns:
- a List of SpacePermission objects
-
removePermissionsForUser
-
removePermissionsForGroup
-
removePermissionsForSpace
Description copied from interface:SpacePermissionDao
Removes all permissions in space- Specified by:
removePermissionsForSpace
in interfaceSpacePermissionDao
- Parameters:
space
- the Space that permissions will be removed from
-
findPermissionTypes
Description copied from interface:SpacePermissionDao
Find all permission types matching the combination of (space, user, group, authenticated access subject) in permission.- Specified by:
findPermissionTypes
in interfaceSpacePermissionDao
- Parameters:
permission
- the permission to look up- Returns:
- a List of SpacePermission objects
-