Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface PermissionService


public interface PermissionService

Provides a webservice for managing permissions on users and groups.

See Also:
Permissions

Method Summary
 void addAnonymousUserPermission(long permission, boolean additive)
          Add the specified permission to all anonymous/guest users.
 void addCommunityPermissionToGroup(long permission, boolean additive, long groupID, long communityID)
          Add the specified permission on the specified community to the group with the specified id.
 void addCommunityPermissionToUser(long permission, boolean additive, long userID, long communityID)
          Add the specified permission on the specified community to the user with the specified id.
 void addPermissionToGroup(long permission, boolean additive, long groupID)
          Add the specified permission to the group with the specified id.
 void addPermissionToUser(long permission, boolean additive, long userID)
          Add the specified permission to the user with the specified id.
 void addRegisteredUserPermission(long permission, boolean additive)
          Add the specified permission to all registered users
 boolean anonymousUserHasPermission(long permission, boolean additive)
          Returns true if the anonymous users have a particular permission globally.
 boolean anonymousUserHasPermissionOnCommunity(long permission, boolean additive, long communityID)
          Returns true if the anonymous users have a particular permission on the community with the specified ID.
 void authenticate(java.lang.String username, java.lang.String password)
          Returns if the username and password are valid; otherwise this method throws an UnauthorizedException.
 boolean isAuthorized(long permission)
          Returns true if the current user has globally has the specified permission.
 boolean isAuthorizedOnCommunity(long permission, long communityID)
          Returns true if the current user has the permission specified on the specified community.
 boolean isGroupAuthorized(long permission, long groupID, int objectType, long objectID)
          Returns true if the specified group has the specified permission on the specified jive Object.
 boolean isUserAuthorized(long permission, long userID)
          Check to see if the specified user has the particular permission system wide.
 boolean isUserAuthorizedOnCommunity(long permission, long userID, long communityID)
          Check to see if the specified user has the particular permission on the specified community.
 WSJiveObject noOp()
          Hack to elimite SEVERE errors logged by celtix because the UnauthorizedException isn't getting registered properly in the generated schema and can't be found as an xml type when searching by QName.
 boolean registeredUserHasPermission(long permission, boolean additive)
          Returns true if registered users have a particular permission globally.
 boolean registeredUserHasPermissionOnCommunity(long permission, boolean additive, long communityID)
          Returns true if registered users have a particular permission on the community with the specified ID.
 void removeAnonymousUserPermission(long permission, boolean additive)
          Remove the specified permission from anonymous users
 void removeCommunityPermissionFromGroup(long permission, boolean additive, long groupID, long communityID)
          Remove the specified permission on the specified community from the group with the specified id.
 void removeCommunityPermissionFromUser(long permission, boolean additive, long userID, long communityID)
          Remove the specified permission on the specified community from the user with the specified id.
 void removePermissionFromGroup(long permission, boolean additive, long groupID)
          Remove the specified permission from the group with the specified id.
 void removePermissionFromUser(long permission, boolean additive, long userID)
          Remove the specified permission from the user with the specified id.
 void removeRegisteredUserPermission(long permission, boolean additive)
          Remove the specified permission from all registered users
 long[] usersWithPermission(long permission, boolean additive)
          Returns all the userID's of users with a particular permission.
 int usersWithPermissionCount(long permission, boolean additive)
          Returns a count of the users that have a particular permission.
 int usersWithPermissionCountOnCommunity(long permission, boolean additive, long communityID)
          Returns a count of the users that have a particular permission on the specified community.
 long[] usersWithPermissionOnCommunity(long permission, boolean additive, long communityID)
          Returns all the userID's of users with a particular permission on the specified community.
 

Method Detail

addPermissionToUser

void addPermissionToUser(long permission,
                         boolean additive,
                         long userID)
                         throws UserNotFoundException
Add the specified permission to the user with the specified id.

Parameters:
permission - The permission to add to a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
userID - The id of the user to add a permission too.
Throws:
UserNotFoundException - - if no user matches the specified userID

removePermissionFromUser

void removePermissionFromUser(long permission,
                              boolean additive,
                              long userID)
                              throws UserNotFoundException
Remove the specified permission from the user with the specified id.

Parameters:
permission - The permission remove from a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
userID - The id of the user to remove a permission from.
Throws:
UserNotFoundException - - if no user matches the specified userID

addAnonymousUserPermission

void addAnonymousUserPermission(long permission,
                                boolean additive)
Add the specified permission to all anonymous/guest users.

Parameters:
permission - The permission to add to a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.

removeAnonymousUserPermission

void removeAnonymousUserPermission(long permission,
                                   boolean additive)
Remove the specified permission from anonymous users

Parameters:
permission - The permission remove from a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.

addRegisteredUserPermission

void addRegisteredUserPermission(long permission,
                                 boolean additive)
Add the specified permission to all registered users

Parameters:
permission - The permission to add to a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.

removeRegisteredUserPermission

void removeRegisteredUserPermission(long permission,
                                    boolean additive)
Remove the specified permission from all registered users

Parameters:
permission - The permission remove from a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.

addPermissionToGroup

void addPermissionToGroup(long permission,
                          boolean additive,
                          long groupID)
                          throws GroupNotFoundException
Add the specified permission to the group with the specified id.

Parameters:
permission - The permission to add to a group.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
groupID - The id of the group to add a permission too.
Throws:
GroupNotFoundException

removePermissionFromGroup

void removePermissionFromGroup(long permission,
                               boolean additive,
                               long groupID)
                               throws GroupNotFoundException
Remove the specified permission from the group with the specified id.

Parameters:
permission - The permission remove from a group.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
groupID - The id of the group to remove a permission from.
Throws:
GroupNotFoundException

addCommunityPermissionToUser

void addCommunityPermissionToUser(long permission,
                                  boolean additive,
                                  long userID,
                                  long communityID)
                                  throws UserNotFoundException,
                                         CommunityNotFoundException,
                                         UnauthorizedException
Add the specified permission on the specified community to the user with the specified id.

Parameters:
permission - The permission to add to a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
userID - The id of the user to add a permission too.
communityID - The ID of the community to add the permission on
Throws:
UnauthorizedException
CommunityNotFoundException
UserNotFoundException

removeCommunityPermissionFromUser

void removeCommunityPermissionFromUser(long permission,
                                       boolean additive,
                                       long userID,
                                       long communityID)
                                       throws UserNotFoundException,
                                              CommunityNotFoundException,
                                              UnauthorizedException
Remove the specified permission on the specified community from the user with the specified id.

Parameters:
permission - The permission remove from a user.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
userID - The id of the user to remove a permission from.
communityID - The ID of the community to remove the permission from.
Throws:
UnauthorizedException
CommunityNotFoundException
UserNotFoundException

isAuthorized

boolean isAuthorized(long permission)
Returns true if the current user has globally has the specified permission. Certain methods of this class are restricted to certain permissions as specified in the method comments.

Parameters:
permission - a permission type.
Returns:
True If the permssion exists globally for the current user.

isAuthorizedOnCommunity

boolean isAuthorizedOnCommunity(long permission,
                                long communityID)
                                throws CommunityNotFoundException
Returns true if the current user has the permission specified on the specified community.

Parameters:
permission - a permission type.
communityID - to see if the current user has permission on.
Returns:
true if the current user has the permissions.
Throws:
CommunityNotFoundException

registeredUserHasPermission

boolean registeredUserHasPermission(long permission,
                                    boolean additive)
Returns true if registered users have a particular permission globally. "Registered Users" does not refer to the static current list of users. Instead, it dynamically matches to any member of the user database.

Parameters:
permission - The permission to check.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
Returns:
true if all registered users have the specified permission.

registeredUserHasPermissionOnCommunity

boolean registeredUserHasPermissionOnCommunity(long permission,
                                               boolean additive,
                                               long communityID)
                                               throws CommunityNotFoundException
Returns true if registered users have a particular permission on the community with the specified ID. "Registered Users" does not refer to the static current list of users. Instead, it dynamically matches to any member of the user database.

Parameters:
permission - The permission to check.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
communityID - The ID of the community to check the permission on.
Returns:
true if all registered users have the specified permission.
Throws:
CommunityNotFoundException

anonymousUserHasPermission

boolean anonymousUserHasPermission(long permission,
                                   boolean additive)
Returns true if the anonymous users have a particular permission globally.

Parameters:
permission - The permission to see if anonymous users have this permission.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
Returns:
True if anonymous users have the specified permission.

anonymousUserHasPermissionOnCommunity

boolean anonymousUserHasPermissionOnCommunity(long permission,
                                              boolean additive,
                                              long communityID)
                                              throws CommunityNotFoundException
Returns true if the anonymous users have a particular permission on the community with the specified ID.

Parameters:
permission - The permission to see if anonymous users have this permission on the specified community.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
communityID - The ID of the community to check to see if a user has permission on.
Returns:
True if anonymous users have the specified permission.
Throws:
CommunityNotFoundException

usersWithPermissionCount

int usersWithPermissionCount(long permission,
                             boolean additive)
Returns a count of the users that have a particular permission. This count does not include the special "anonymous users" and "registered users" permission types.

Parameters:
permission - the permission to check.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
Returns:
a count of the users that have a particular permission.

usersWithPermission

long[] usersWithPermission(long permission,
                           boolean additive)
Returns all the userID's of users with a particular permission. This list does not include the special "anonymous users" and "registered users" permission types. This method is not the normal method for determining if a user has a certain permission on an object in the system; instead it is only useful for permission management. For example, to check if a user has(perm), where community is the community you want to check perms on.

Parameters:
permission - the permission to check.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
Returns:
an Iterator of all the users with the specified permission.

usersWithPermissionCountOnCommunity

int usersWithPermissionCountOnCommunity(long permission,
                                        boolean additive,
                                        long communityID)
                                        throws CommunityNotFoundException
Returns a count of the users that have a particular permission on the specified community. This count does not include the special "anonymous users" and "registered users" permission types.

Parameters:
permission - the permission to check.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects
communityID - The id of the community..
Returns:
a count of the users that have a particular permission.
Throws:
CommunityNotFoundException

usersWithPermissionOnCommunity

long[] usersWithPermissionOnCommunity(long permission,
                                      boolean additive,
                                      long communityID)
                                      throws CommunityNotFoundException
Returns all the userID's of users with a particular permission on the specified community. This list does not include the special "anonymous users" and "registered users" permission types. This method is not the normal method for determining if a user has a certain permission on an object in the system; instead it is only useful for permission management. For example, to check if a user has(perm), where community is the community you want to check perms on.

Parameters:
permission - the permission to check.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
communityID - The ID of the community to get users with the specified permission.
Returns:
an array of ids of the users with the specified permission.
Throws:
CommunityNotFoundException

removeCommunityPermissionFromGroup

void removeCommunityPermissionFromGroup(long permission,
                                        boolean additive,
                                        long groupID,
                                        long communityID)
                                        throws GroupNotFoundException,
                                               CommunityNotFoundException,
                                               UnauthorizedException
Remove the specified permission on the specified community from the group with the specified id.

Parameters:
permission - The permission remove from a group.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
groupID - The id of the group to remove a permission from.
communityID - The ID of the community to remove the permission from.
Throws:
UnauthorizedException
CommunityNotFoundException
GroupNotFoundException

addCommunityPermissionToGroup

void addCommunityPermissionToGroup(long permission,
                                   boolean additive,
                                   long groupID,
                                   long communityID)
                                   throws GroupNotFoundException,
                                          CommunityNotFoundException,
                                          UnauthorizedException
Add the specified permission on the specified community to the group with the specified id.

Parameters:
permission - The permission to add to a group.
additive - True if the permission should be 'added' to the permissions retrieved from a parent object(s). This means that if the permission has been already set in a parent object, it will be inherited by all child objects.
groupID - The id of the group to add a permission too.
communityID - The ID of the community to add the permission on
Throws:
UnauthorizedException
CommunityNotFoundException
GroupNotFoundException

isUserAuthorized

boolean isUserAuthorized(long permission,
                         long userID)
Check to see if the specified user has the particular permission system wide.

Parameters:
permission - The permission to add to check.
userID - The id of the user.
Returns:
True if the user has the specified permission.

isUserAuthorizedOnCommunity

boolean isUserAuthorizedOnCommunity(long permission,
                                    long userID,
                                    long communityID)
                                    throws CommunityNotFoundException
Check to see if the specified user has the particular permission on the specified community.

Parameters:
permission - The permission to add to check.
userID - The id of the user.
communityID - The id of the community.
Returns:
True if the user has the permission.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

authenticate

void authenticate(java.lang.String username,
                  java.lang.String password)
                  throws UnauthorizedException
Returns if the username and password are valid; otherwise this method throws an UnauthorizedException.

Parameters:
username - The username to authenticate.
password - The password .
Throws:
UnauthorizedException - if the username and password do not match any existing user.

isGroupAuthorized

boolean isGroupAuthorized(long permission,
                          long groupID,
                          int objectType,
                          long objectID)
Returns true if the specified group has the specified permission on the specified jive Object.

Parameters:
permission - The permission to test for.
groupID - The group to test for the permission
objectType - The type of object to test against.
objectID - The id of the object to test against.
Returns:
True if the group is authorized.

noOp

WSJiveObject noOp()
Hack to elimite SEVERE errors logged by celtix because the UnauthorizedException isn't getting registered properly in the generated schema and can't be found as an xml type when searching by QName.

Returns:
noop = throws UnsupportedOperationException

Clearspace Project Page

Copyright © 1999-2007 Jive Software.