Get Roles for User
Get all roles for a specific user
.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Query endpoint instead.
Endpoint
GET /v1/users/:userId/roles
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/users/15ksdf87a23g/roles" \
-H "Authorization: ApiKey YOUR_KEY"
userRoles, err := role.ListRolesForUser("15ksdf87a23g", &warrant.ListRoleParams{
ListParams: warrant.ListParams{
Limit: 10,
},
})
if err != nil {
// handle error
}
ListResult<Role> roles = client.listRolesForUser("15ksdf87a23g", new ListParams().withLimit(10));
// Class method
const roles = await warrantClient.Role.listRolesForUser("15ksdf87a23g", { limit: 10 });
// Instance method
const user = await warrantClient.User.get("15ksdf87a23g");
const roles = await user.listRoles({ limit: 10 });
# Class method
user_roles = warrant.Role.list_for_user("15ksdf87a23g")
# Instance method
user = warrant.User.get("15ksdf87a23g")
user_roles = user.list_roles()
# Class method
user_roles = Warrant::Role.list_for_user("15ksdf87a23g", { limit: 10 })
# Instance method
user = Warrant::User.get("15ksdf87a23g")
user_roles = user.list_roles({ limit: 10 })
Response
[
{
"roleId": "admin"
}
]