Class HibernateSpacePermissionDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<SpacePermission>
-
- com.atlassian.confluence.security.persistence.dao.hibernate.HibernateSpacePermissionDao
-
- All Implemented Interfaces:
ObjectDao
,VersionedObjectDao<SpacePermission>
,ObjectDaoInternal<SpacePermission>
,VersionedObjectDaoInternal<SpacePermission>
,SpacePermissionDao
,org.springframework.beans.factory.InitializingBean
public class HibernateSpacePermissionDao extends VersionedHibernateObjectDao<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 com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
-
-
Constructor Summary
Constructors Constructor Description HibernateSpacePermissionDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<SpacePermission>
findAllGlobalPermissions()
Retreives all global permissionsList<SpacePermission>
findAllGlobalPermissionsForType(String permissionType)
Retrieves all global permissions of type permissionTypeCollection<SpacePermission>
findGlobalGroupPermissions(String permissionType)
Find all global group permissions of typepermissionType
.Collection<SpacePermission>
findGroupPermissionsForSpace(Space space, String permissionType)
Find all group permissions of typepermissionType
forspace
.List<SpacePermission>
findPermissionsForGroup(String group)
Retrieves all permissions for groupList<SpacePermission>
findPermissionsForSpace(Space space)
Retrieves all permissions for spaceList<SpacePermissionDTOLight>
findPermissionsForSpacesAndTypes(Set<Long> spaceIdList, Collection<String> typeList)
Retrieves all permissions for the provides space list.List<SpacePermission>
findPermissionsForUser(ConfluenceUser user)
Retrieves all permissions for userList
findPermissionTypes(SpacePermission permission)
Find all permission types matching the combination of (space, user, group, authenticated access subject) in permission.SpacePermission
getById(long id)
Retrieves a single SpacePermission by its IDClass<SpacePermission>
getPersistentClass()
Gets the type ofEntityObject
this Dao works with.boolean
hasPermission(SpacePermission permission)
Determines whether permission exists in the data storevoid
removePermissionsForGroup(String group)
Removes all permissions for groupvoid
removePermissionsForSpace(Space space)
Removes all permissions in spacevoid
removePermissionsForUser(String userName)
Removes all permissions for userName-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, getHibernateTemplate, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
-
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.internal.persistence.ObjectDaoInternal
findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
-
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
-
-
-
-
Method Detail
-
getPersistentClass
public Class<SpacePermission> getPersistentClass()
Description copied from interface:ObjectDaoInternal
Gets the type ofEntityObject
this Dao works with.- Specified by:
getPersistentClass
in interfaceObjectDao
- Specified by:
getPersistentClass
in interfaceObjectDaoInternal<SpacePermission>
- Returns:
- the type
-
getById
public SpacePermission getById(long id)
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
public boolean hasPermission(SpacePermission permission)
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
public List<SpacePermission> findAllGlobalPermissions()
Description copied from interface:SpacePermissionDao
Retreives all global permissions- Specified by:
findAllGlobalPermissions
in interfaceSpacePermissionDao
- Returns:
- a List of matching SpacePermission objects
-
findAllGlobalPermissionsForType
public List<SpacePermission> findAllGlobalPermissionsForType(String permissionType)
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
public List<SpacePermission> findPermissionsForGroup(String group)
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
public List<SpacePermission> findPermissionsForSpace(Space space)
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
public Collection<SpacePermission> findGroupPermissionsForSpace(Space space, String permissionType)
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
public Collection<SpacePermission> findGlobalGroupPermissions(String permissionType)
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
-
findPermissionsForUser
public List<SpacePermission> findPermissionsForUser(ConfluenceUser user)
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
public void removePermissionsForUser(String userName)
Description copied from interface:SpacePermissionDao
Removes all permissions for userName- Specified by:
removePermissionsForUser
in interfaceSpacePermissionDao
- Parameters:
userName
- the User whose permissions will be removed
-
removePermissionsForGroup
public void removePermissionsForGroup(String group)
Description copied from interface:SpacePermissionDao
Removes all permissions for group- Specified by:
removePermissionsForGroup
in interfaceSpacePermissionDao
- Parameters:
group
- the Group whose permissions will be removed
-
removePermissionsForSpace
public void removePermissionsForSpace(Space space)
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
public List findPermissionTypes(SpacePermission permission)
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
-
-