Clearspace API (1.10.16) 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 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.
 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.
 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 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.
 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 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.
 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

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

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
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:
UserNotFoundException

removeCommunityPermissionFromUser

void removeCommunityPermissionFromUser(long permission,
                                       boolean additive,
                                       long userID,
                                       long communityID)
                                       throws UserNotFoundException
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:
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
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:
GroupNotFoundException

addCommunityPermissionToGroup

void addCommunityPermissionToGroup(long permission,
                                   boolean additive,
                                   long groupID,
                                   long communityID)
                                   throws GroupNotFoundException
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:
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.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.