Project Roles of a Specific User
This resource provides access to the roles of a specific user that they have for a specific project.
Resource | <Hub Service URL>/api/rest/users/{userID}/projectroles |
Returned entity | ProjectRole. For the description of the entity attributes, see ProjectRole Attributes. |
Supported methods |
ProjectRole Attributes
Represents a role that a user has in a specific project.
Attributes
This table describes attributes of the ProjectRole
entity.
To receive an attribute in the response from the server, specify it explicitly in the
fields
request parameter.To update an attribute, provide it in the body of a POST request.
Field | Type | Description |
---|---|---|
id | String | The unique identifier of the project role. |
owner | Set.<authorityHolder> | The list of users and groups that this project role is granted to. |
project | Set.<project> | The list of projects in which the role is used as a resource. |
role | Set.<role> | The role that the user has in the project. |
Read a List of Project Roles of a User
Get all project roles of a user that match the specified query.
Request Syntax
Request Parameters
Parameter | Type | Description |
---|---|---|
fields | String | Optional. Returns only the specified subset of the fields for each ProjectRole. Use Fields Syntax to define the subset. |
$skip | Int | Optional. Lets you set a number of returned entities to skip before returning the first one. |
$top | Int | Optional. Lets you specify the maximum number of ProjectRoles that are returned in the response. |
query | String | Optional. Lets you specify a search query to filter the returned results. See Query Syntax for the definition of supported logical operations syntax. For the ProjectRole fields and tuples, see Hub REST API Reference. |
orderBy | String | Optional Returns the list of ProjectRoles sorted by a specified field. See Sorting Syntax for details. ProjectRoles support ordering by the following fields: |
Sample
Request
Response Body
Add a New Project Role to the User
Add a new project role to the user.
Required fields: id
of the project, id
of the role.
Request Syntax
Request Parameters
Parameter | Type | Description |
---|---|---|
fields | String | A list of ProjectRole attributes that should be returned in the response. If no field is specified, only the |
Sample
In this example, we add the Contributor role for the Model Engineering project to a user.