com.atlassian.confluence.security.persistence.dao.hibernate
Class HibernateSpacePermissionDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
                  extended by com.atlassian.confluence.security.persistence.dao.hibernate.HibernateSpacePermissionDao
All Implemented Interfaces:
ObjectDao, VersionedObjectDao, SpacePermissionDao, org.springframework.beans.factory.InitializingBean

public class HibernateSpacePermissionDao
extends VersionedHibernateObjectDao
implements SpacePermissionDao


Field Summary
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateSpacePermissionDao()
           
 
Method Summary
 java.util.List<SpacePermission> findAllGlobalPermissions()
          Retreives all global permissions
 java.util.List<SpacePermission> findAllGlobalPermissionsForType(java.lang.String permissionType)
          Retrieves all global permissions of type permissionType
 java.util.Collection<SpacePermission> findGlobalGroupPermissions(java.lang.String permissionType)
          Find all global group permissions of type permissionType.
 java.util.Collection<SpacePermission> findGroupPermissionsForSpace(Space space, java.lang.String permissionType)
          Find all group permissions of type permissionType for space.
 java.util.List<SpacePermission> findPermissionsForGroup(java.lang.String group)
          Retrieves all permissions for group
 java.util.List<SpacePermission> findPermissionsForSpace(Space space)
          Retrieves all permissions for space
 java.util.List<SpacePermission> findPermissionsForUser(ConfluenceUser user)
          Retrieves all permissions for user
 java.util.List<SpacePermission> findPermissionsForUser(java.lang.String userName)
          Deprecated. 
 java.util.List findPermissionTypes(SpacePermission permission)
          Find all permission types matching the combination of (space, user, group) in permission.
 SpacePermission getById(long id)
          Retrieves a single SpacePermission by its ID
 java.lang.Class getPersistentClass()
           
 boolean hasPermission(SpacePermission permission)
          Determines whether permission exists in the data store
 void removePermissionsForGroup(java.lang.String group)
          Removes all permissions for group
 void removePermissionsForSpace(Space space)
          Removes all permissions in space
 void removePermissionsForUser(java.lang.String userName)
          Removes all permissions for userName
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, findNamedQueryStringParams, save, setCacheFactory, setConfluenceUserDao, updateModificationData
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
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.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

HibernateSpacePermissionDao

public HibernateSpacePermissionDao()
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao

getById

public SpacePermission getById(long id)
Description copied from interface: SpacePermissionDao
Retrieves a single SpacePermission by its ID

Specified by:
getById in interface SpacePermissionDao
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 interface SpacePermissionDao
Parameters:
permission - the SpacePermission to look up
Returns:
true if it exists, false otherwise

findAllGlobalPermissions

public java.util.List<SpacePermission> findAllGlobalPermissions()
Description copied from interface: SpacePermissionDao
Retreives all global permissions

Specified by:
findAllGlobalPermissions in interface SpacePermissionDao
Returns:
a List of matching SpacePermission objects

findAllGlobalPermissionsForType

public java.util.List<SpacePermission> findAllGlobalPermissionsForType(java.lang.String permissionType)
Description copied from interface: SpacePermissionDao
Retrieves all global permissions of type permissionType

Specified by:
findAllGlobalPermissionsForType in interface SpacePermissionDao
Parameters:
permissionType - the SpacePermission type to look up
Returns:
a List of matching SpacePermission objects

findPermissionsForGroup

public java.util.List<SpacePermission> findPermissionsForGroup(java.lang.String group)
Description copied from interface: SpacePermissionDao
Retrieves all permissions for group

Specified by:
findPermissionsForGroup in interface SpacePermissionDao
Parameters:
group - the group to look up
Returns:
a List of SpacePermission objects

findPermissionsForSpace

public java.util.List<SpacePermission> findPermissionsForSpace(Space space)
Description copied from interface: SpacePermissionDao
Retrieves all permissions for space

Specified by:
findPermissionsForSpace in interface SpacePermissionDao
Parameters:
space - the Space to look up
Returns:
a List of SpacePermission objects

findGroupPermissionsForSpace

public java.util.Collection<SpacePermission> findGroupPermissionsForSpace(Space space,
                                                                          java.lang.String permissionType)
Description copied from interface: SpacePermissionDao
Find all group permissions of type permissionType for space.

Specified by:
findGroupPermissionsForSpace in interface SpacePermissionDao
permissionType - one of the constants in SpacePermission, such as SpacePermission.VIEWSPACE_PERMISSION.
Returns:
a non-null collection of permissions

findGlobalGroupPermissions

public java.util.Collection<SpacePermission> findGlobalGroupPermissions(java.lang.String permissionType)
Description copied from interface: SpacePermissionDao
Find all global group permissions of type permissionType.

Specified by:
findGlobalGroupPermissions in interface SpacePermissionDao
Parameters:
permissionType - one of the constants in SpacePermission, such as SpacePermission.USE_CONFLUENCE_PERMISSION.
Returns:
a non-null collection of permissions

findPermissionsForUser

public java.util.List<SpacePermission> findPermissionsForUser(ConfluenceUser user)
Description copied from interface: SpacePermissionDao
Retrieves all permissions for user

Specified by:
findPermissionsForUser in interface SpacePermissionDao
Parameters:
user - the user to look up
Returns:
a List of SpacePermission objects

findPermissionsForUser

@Deprecated
public java.util.List<SpacePermission> findPermissionsForUser(java.lang.String userName)
Deprecated. 

Description copied from interface: SpacePermissionDao
Retrieves all permissions for userName

Specified by:
findPermissionsForUser in interface SpacePermissionDao
Parameters:
userName - the username to look up
Returns:
a List of SpacePermission objects

removePermissionsForUser

public void removePermissionsForUser(java.lang.String userName)
Description copied from interface: SpacePermissionDao
Removes all permissions for userName

Specified by:
removePermissionsForUser in interface SpacePermissionDao
Parameters:
userName - the User whose permissions will be removed

removePermissionsForGroup

public void removePermissionsForGroup(java.lang.String group)
Description copied from interface: SpacePermissionDao
Removes all permissions for group

Specified by:
removePermissionsForGroup in interface SpacePermissionDao
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 interface SpacePermissionDao
Parameters:
space - the Space that permissions will be removed from

findPermissionTypes

public java.util.List findPermissionTypes(SpacePermission permission)
Description copied from interface: SpacePermissionDao
Find all permission types matching the combination of (space, user, group) in permission.

Specified by:
findPermissionTypes in interface SpacePermissionDao
Parameters:
permission - the permission to look up
Returns:
a List of SpacePermission objects


Copyright © 2003-2014 Atlassian. All Rights Reserved.