com.atlassian.confluence.hosted
Class DefaultSpaceGroupPermissionManager

java.lang.Object
  extended by com.atlassian.confluence.hosted.DefaultSpaceGroupPermissionManager
All Implemented Interfaces:
SpaceGroupPermissionManager

public class DefaultSpaceGroupPermissionManager
extends java.lang.Object
implements SpaceGroupPermissionManager


Constructor Summary
DefaultSpaceGroupPermissionManager(SpaceGroupPermissionDao spaceGroupPermissionDao)
           
 
Method Summary
 java.util.List<SpaceGroupPermission> getPermissionsForUser(java.lang.String username)
          Get space group permissions for the user.
 java.util.List<java.lang.String> getUsersWithPermission(SpaceGroup spaceGroup, java.lang.String type)
          Returns a collection of usernames with VIEWSPACEGROUP_PERMISSION in the spacegroup.
 boolean hasPermission(java.lang.String permissionType, SpaceGroup spaceGroup, com.atlassian.user.User remoteUser)
          Determines if remoteUser has the given permission in space
 void removeAllGroupPermissions(java.lang.String groupname)
          Removes all permissions on the space-group for a particular user-group
 void removeAllPermissionsForSpaceGroup(SpaceGroup spaceGroup)
          Removes all permissions on the space-group for a particular SpaceGroup
 void removeAllUserPermissions(java.lang.String username)
          Removes all permissions on the space-group for a particular user
 void removePermission(SpaceGroupPermission permission)
          Removes a single SpaceGroupPermission
 void savePermission(SpaceGroupPermission permission)
          Saves the permission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSpaceGroupPermissionManager

public DefaultSpaceGroupPermissionManager(SpaceGroupPermissionDao spaceGroupPermissionDao)
Method Detail

savePermission

public void savePermission(SpaceGroupPermission permission)
Description copied from interface: SpaceGroupPermissionManager
Saves the permission.

Specified by:
savePermission in interface SpaceGroupPermissionManager

removePermission

public void removePermission(SpaceGroupPermission permission)
Description copied from interface: SpaceGroupPermissionManager
Removes a single SpaceGroupPermission

Specified by:
removePermission in interface SpaceGroupPermissionManager
Parameters:
permission - The SpaceGroupPermission that should be removed

removeAllUserPermissions

public void removeAllUserPermissions(java.lang.String username)
Description copied from interface: SpaceGroupPermissionManager
Removes all permissions on the space-group for a particular user

Specified by:
removeAllUserPermissions in interface SpaceGroupPermissionManager
Parameters:
username - the name of the user whose permissions should be removed

removeAllGroupPermissions

public void removeAllGroupPermissions(java.lang.String groupname)
Description copied from interface: SpaceGroupPermissionManager
Removes all permissions on the space-group for a particular user-group

Specified by:
removeAllGroupPermissions in interface SpaceGroupPermissionManager
Parameters:
groupname - the name of the user group

removeAllPermissionsForSpaceGroup

public void removeAllPermissionsForSpaceGroup(SpaceGroup spaceGroup)
Description copied from interface: SpaceGroupPermissionManager
Removes all permissions on the space-group for a particular SpaceGroup

Specified by:
removeAllPermissionsForSpaceGroup in interface SpaceGroupPermissionManager
Parameters:
spaceGroup - the name of the SpaceGroup

hasPermission

public boolean hasPermission(java.lang.String permissionType,
                             SpaceGroup spaceGroup,
                             com.atlassian.user.User remoteUser)
Description copied from interface: SpaceGroupPermissionManager
Determines if remoteUser has the given permission in space

Specified by:
hasPermission in interface SpaceGroupPermissionManager
Parameters:
permissionType - The permission type to look up
spaceGroup - The spacegroup the permission applies to (can not be null)
remoteUser - The user to look up (can be null for the anonymous user)
Returns:
true if remoteUser has the permission, false otherwise

getUsersWithPermission

public java.util.List<java.lang.String> getUsersWithPermission(SpaceGroup spaceGroup,
                                                               java.lang.String type)
Description copied from interface: SpaceGroupPermissionManager
Returns a collection of usernames with VIEWSPACEGROUP_PERMISSION in the spacegroup. If no space is provided A list of users with USE_CONFLUENCE_PERMISSION will be returned

Specified by:
getUsersWithPermission in interface SpaceGroupPermissionManager
Parameters:
spaceGroup - - space to query, if null global permissions returned
Returns:
Collection of ssernames

getPermissionsForUser

public java.util.List<SpaceGroupPermission> getPermissionsForUser(java.lang.String username)
Description copied from interface: SpaceGroupPermissionManager
Get space group permissions for the user.

Specified by:
getPermissionsForUser in interface SpaceGroupPermissionManager
Returns:
space group permissions for the user.


Copyright © 2003-2014 Atlassian. All Rights Reserved.