public class

HibernateSpacePermissionDao

extends VersionedHibernateObjectDao<T extends EntityObject>
implements SpacePermissionDao
java.lang.Object
   ↳ org.springframework.dao.support.DaoSupport
     ↳ org.springframework.orm.hibernate.support.HibernateDaoSupport
       ↳ com.atlassian.hibernate.HibernateObjectDao
         ↳ com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
           ↳ com.atlassian.confluence.security.persistence.dao.hibernate.HibernateSpacePermissionDao

Summary

[Expand]
Inherited Fields
From class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
From class com.atlassian.hibernate.HibernateObjectDao
From class org.springframework.dao.support.DaoSupport
Public Constructors
HibernateSpacePermissionDao()
Public Methods
List<SpacePermission> findAllGlobalPermissions()
Retreives all global permissions
List<SpacePermission> findAllGlobalPermissionsForType(String permissionType)
Retrieves all global permissions of type permissionType
Collection<SpacePermission> findGlobalGroupPermissions(String permissionType)
Find all global group permissions of type permissionType.
Collection<SpacePermission> findGroupPermissionsForSpace(Space space, String permissionType)
Find all group permissions of type permissionType for space.
List findPermissionTypes(SpacePermission permission)
Find all permission types matching the combination of (space, user, group) in permission.
List<SpacePermission> findPermissionsForGroup(String group)
Retrieves all permissions for group
List<SpacePermission> findPermissionsForSpace(Space space)
Retrieves all permissions for space
List<SpacePermission> findPermissionsForUser(String userName)
Retrieves all permissions for userName
SpacePermission getById(long id)
Retrieves a single SpacePermission by its ID
Class getPersistentClass()
boolean hasPermission(SpacePermission permission)
Determines whether permission exists in the data store
void removePermissionsForGroup(String group)
Removes all permissions for group
void removePermissionsForSpace(Space space)
Removes all permissions in space
void removePermissionsForUser(String userName)
Removes all permissions for userName
[Expand]
Inherited Methods
From class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
From class com.atlassian.hibernate.HibernateObjectDao
From class org.springframework.orm.hibernate.support.HibernateDaoSupport
From class org.springframework.dao.support.DaoSupport
From class java.lang.Object
From interface bucket.core.persistence.ObjectDao
From interface com.atlassian.confluence.core.persistence.VersionedObjectDao
From interface com.atlassian.confluence.security.persistence.dao.SpacePermissionDao
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public HibernateSpacePermissionDao ()

Public Methods

public List<SpacePermission> findAllGlobalPermissions ()

Retreives all global permissions

Returns
  • a List of matching SpacePermission objects

public List<SpacePermission> findAllGlobalPermissionsForType (String permissionType)

Retrieves all global permissions of type permissionType

Parameters
permissionType the SpacePermission type to look up
Returns
  • a List of matching SpacePermission objects

public Collection<SpacePermission> findGlobalGroupPermissions (String permissionType)

Find all global group permissions of type permissionType.

Parameters
permissionType one of the constants in SpacePermission, such as USE_CONFLUENCE_PERMISSION.
Returns
  • a non-null collection of permissions

public Collection<SpacePermission> findGroupPermissionsForSpace (Space space, String permissionType)

Find all group permissions of type permissionType for space.

Parameters
permissionType one of the constants in SpacePermission, such as VIEWSPACE_PERMISSION.
Returns
  • a non-null collection of permissions

public List findPermissionTypes (SpacePermission permission)

Find all permission types matching the combination of (space, user, group) in permission.

Parameters
permission the permission to look up
Returns
  • a List of SpacePermission objects

public List<SpacePermission> findPermissionsForGroup (String group)

Retrieves all permissions for group

Parameters
group the group to look up
Returns
  • a List of SpacePermission objects

public List<SpacePermission> findPermissionsForSpace (Space space)

Retrieves all permissions for space

Parameters
space the Space to look up
Returns
  • a List of SpacePermission objects

public List<SpacePermission> findPermissionsForUser (String userName)

Retrieves all permissions for userName

Parameters
userName the username to look up
Returns
  • a List of SpacePermission objects

public SpacePermission getById (long id)

Retrieves a single SpacePermission by its ID

Parameters
id the SpacePermission to retrieve
Returns
  • a SpacePermission object, or null if it could not be found

public Class getPersistentClass ()

public boolean hasPermission (SpacePermission permission)

Determines whether permission exists in the data store

Parameters
permission the SpacePermission to look up
Returns
  • true if it exists, false otherwise

public void removePermissionsForGroup (String group)

Removes all permissions for group

Parameters
group the Group whose permissions will be removed

public void removePermissionsForSpace (Space space)

Removes all permissions in space

Parameters
space the Space that permissions will be removed from

public void removePermissionsForUser (String userName)

Removes all permissions for userName

Parameters
userName the User whose permissions will be removed