Web Services API: How to get all Workspace users and query by Permission
search cancel

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

book

Article ID: 111599

calendar_today

Updated On:

Products

Rally On-Premise Rally SaaS

Issue/Introduction

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?

Environment

Release:
Component: ACSAAS

Resolution

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. 


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 = <WORKSPACE_OID>)

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

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

4. To get a list of Workspaces accessible by a specific user.
(User.username = "<USERNAME>")     - find by username
((User.FirstName = "<FIRSTNAME>") and (User.LastName = "<LASTNAME>"))    - find by full name.
(User.ObjectID = <USER_OID>)

5. To get a list of all disabled users in a given Workspace:
((Workspace.ObjectID = <WORKSPACE_OID>) and (User.Disabled = True))