com.atlassian.confluence.hosted
Interface SpaceGroupPermissionManager

All Known Implementing Classes:
DefaultSpaceGroupPermissionManager

public interface SpaceGroupPermissionManager


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.
 

Method Detail

savePermission

void savePermission(SpaceGroupPermission permission)
Saves the permission.


hasPermission

boolean hasPermission(java.lang.String permissionType,
                      SpaceGroup spaceGroup,
                      com.atlassian.user.User remoteUser)
Determines if remoteUser has the given permission in space

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
Throws:
java.lang.IllegalArgumentException - if spacegroup is null

getUsersWithPermission

java.util.List<java.lang.String> getUsersWithPermission(SpaceGroup spaceGroup,
                                                        java.lang.String type)
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

Parameters:
spaceGroup - - space to query, if null global permissions returned
Returns:
Collection of ssernames
Throws:
java.lang.IllegalArgumentException - if spacegroup is null

getPermissionsForUser

java.util.List<SpaceGroupPermission> getPermissionsForUser(java.lang.String username)
Get space group permissions for the user.

Parameters:
username -
Returns:
space group permissions for the user.
Throws:
java.lang.IllegalArgumentException - if username is null

removePermission

void removePermission(SpaceGroupPermission permission)
Removes a single SpaceGroupPermission

Parameters:
permission - The SpaceGroupPermission that should be removed
Throws:
java.lang.IllegalArgumentException - if username is null

removeAllUserPermissions

void removeAllUserPermissions(java.lang.String username)
Removes all permissions on the space-group for a particular user

Parameters:
username - the name of the user whose permissions should be removed
Throws:
java.lang.IllegalArgumentException - if username is null

removeAllGroupPermissions

void removeAllGroupPermissions(java.lang.String groupname)
Removes all permissions on the space-group for a particular user-group

Parameters:
groupname - the name of the user group
Throws:
java.lang.IllegalArgumentException - if username is null

removeAllPermissionsForSpaceGroup

void removeAllPermissionsForSpaceGroup(SpaceGroup spaceGroup)
Removes all permissions on the space-group for a particular SpaceGroup

Parameters:
spaceGroup - the name of the SpaceGroup
Throws:
java.lang.IllegalArgumentException - if username is null


Copyright © 2003-2010 Atlassian. All Rights Reserved.