Agile Central - Web Services API: How to get all Workspace users and query by Permission

Document ID : KB000111599
Last Modified Date : 17/08/2018
Show Technical Document Details
Question:
What are the permissions on Workspaces?
Can we use WSAPI to get all users of a Workspace?
Can we filter and get only users of certain permission of a Workspace?
Answer:
There are 2 permissions for Workspaces:  User and Admin.

The 'Admin' permission will grant the user a "Workspace Admin" privilege.
The 'User' permission will grant the user access to the Workspace without the admin privileges.

These permissions are stored in the WorkspacePermission endpoint. For each user and Workspace pair there is an entry in that endpoint that marks the fact that this user has access to the Workspace. The specific level of permission ('User' or 'Admin') is kept on the Role field.

Note: The Workspace object is separate of its Projects. The WorkspacePermission entry marks the access level to the Workspace only. It is irrespective of any of the Projects of this Workspace. The project permissions will have to be set separately, are kept separately and need to be separately queried as well. You can refer to this document, to learn how to query for project permissions.


WSAPI can be used to filter for Workspace users along with their permissions. Below are a few examples. All query examples should run against the WorkspacePermission endpoint:

1. To get all Workspace Users (that is all users who have any access to the Workspace):
(Workspace.ObjectID = <ObjectID of your Workspace>)

2. To get only Workspace Admins of a given Workspace:
((Workspace.ObjectID = <ObjectID of your Workspace>) and (Role = "Admin"))

3. To get only the Workspace Users who are not admins:
((Workspace.ObjectID = <ObjectID of your Workspace>) and (Role = "User"))

4. To get a list of Workspaces accessible by a specific user.
(User.username = "<the username of your user>")     - find by username
((User.FirstName = "<the first name of your user>") and (User.LastName = "<the last name of your user>"))    - find by full name.
(User.ObjectID = <the object id of your user>)

5. To get a list of all disabled users in a given Workspace:
((Workspace.ObjectID = <ObjectID of your Workspace>) and (User.Disabled = True))
Additional Information:
More on User and Project permissions, see: https://help.rallydev.com/administer-users#teams

Find this doc on how to Get Project Permissions.