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 typepermissionTypeforspace.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 userListfindPermissionTypes(SpacePermission permission)Find all permission types matching the combination of (space, user, group, authenticated access subject) in permission.SpacePermissiongetById(long id)Retrieves a single SpacePermission by its IDClass<SpacePermission>getPersistentClass()Gets the type ofEntityObjectthis Dao works with.booleanhasPermission(SpacePermission permission)Determines whether permission exists in the data storevoidremovePermissionsForGroup(String group)Removes all permissions for groupvoidremovePermissionsForSpace(Space space)Removes all permissions in spacevoidremovePermissionsForUser(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:ObjectDaoInternalGets the type ofEntityObjectthis Dao works with.- Specified by:
getPersistentClassin interfaceObjectDao- Specified by:
getPersistentClassin interfaceObjectDaoInternal<SpacePermission>- Returns:
- the type
-
getById
public SpacePermission getById(long id)
Description copied from interface:SpacePermissionDaoRetrieves a single SpacePermission by its ID- Specified by:
getByIdin 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:SpacePermissionDaoDetermines whether permission exists in the data store- Specified by:
hasPermissionin interfaceSpacePermissionDao- Parameters:
permission- the SpacePermission to look up- Returns:
- true if it exists, false otherwise
-
findAllGlobalPermissions
public List<SpacePermission> findAllGlobalPermissions()
Description copied from interface:SpacePermissionDaoRetreives all global permissions- Specified by:
findAllGlobalPermissionsin interfaceSpacePermissionDao- Returns:
- a List of matching SpacePermission objects
-
findAllGlobalPermissionsForType
public List<SpacePermission> findAllGlobalPermissionsForType(String permissionType)
Description copied from interface:SpacePermissionDaoRetrieves all global permissions of type permissionType- Specified by:
findAllGlobalPermissionsForTypein 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:SpacePermissionDaoRetrieves all permissions for group- Specified by:
findPermissionsForGroupin 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:SpacePermissionDaoRetrieves all permissions for space- Specified by:
findPermissionsForSpacein 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:
findPermissionsForSpacesAndTypesin 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:SpacePermissionDaoFind all group permissions of typepermissionTypeforspace.- Specified by:
findGroupPermissionsForSpacein interfaceSpacePermissionDaopermissionType- 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:SpacePermissionDaoFind all global group permissions of typepermissionType.- Specified by:
findGlobalGroupPermissionsin 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:SpacePermissionDaoRetrieves all permissions for user- Specified by:
findPermissionsForUserin interfaceSpacePermissionDao- Parameters:
user- the user to look up- Returns:
- a List of SpacePermission objects
-
removePermissionsForUser
public void removePermissionsForUser(String userName)
Description copied from interface:SpacePermissionDaoRemoves all permissions for userName- Specified by:
removePermissionsForUserin interfaceSpacePermissionDao- Parameters:
userName- the User whose permissions will be removed
-
removePermissionsForGroup
public void removePermissionsForGroup(String group)
Description copied from interface:SpacePermissionDaoRemoves all permissions for group- Specified by:
removePermissionsForGroupin interfaceSpacePermissionDao- Parameters:
group- the Group whose permissions will be removed
-
removePermissionsForSpace
public void removePermissionsForSpace(Space space)
Description copied from interface:SpacePermissionDaoRemoves all permissions in space- Specified by:
removePermissionsForSpacein interfaceSpacePermissionDao- Parameters:
space- the Space that permissions will be removed from
-
findPermissionTypes
public List findPermissionTypes(SpacePermission permission)
Description copied from interface:SpacePermissionDaoFind all permission types matching the combination of (space, user, group, authenticated access subject) in permission.- Specified by:
findPermissionTypesin interfaceSpacePermissionDao- Parameters:
permission- the permission to look up- Returns:
- a List of SpacePermission objects
-
-