Web Services Developer's Guide → Web Services API Reference → SBM Administrative Web Services → Administrative Calls → HasUserRole
This service checks for a specified role by name.
Argument | Type | Description |
---|---|---|
auth (optional) | Auth | The Auth type supplies credentials and optionally, a host name for licensing. The userId and password can be specified with HTTP BASIC or WS-SECURITY instead. |
user | UserIdentifier | The user to check against. |
role | RoleIdentifier | The role to verify. |
A boolean is returned, showing whether the user is granted the role in the project (true) or not (false). Either inherited or explicitly granted roles are taken into account. The role is checked in the context of the specified user. For example:
<ae:HasUserRoleResponse> <ae:return>true</ae:return> </ae:HasUserRoleResponse>
You can call GetUserRoles for a group to return a list of available roles. You can then use these roles in the HasUserRole call.
The <urn:user> and <urn:role> parameters uniquely identify the user and role. Providing the <urn:projectId> value in the GroupIdentifier improves performance of the call, especially for the systems with several projects.
The following XML is a snippet of the payload this is sent with HasUserRole.
<urn:HasUserRole> <urn:auth> <urn:userId>bill</urn:userId> <urn:password></urn:password> <urn:hostname></urn:hostname> </urn:auth> <urn:user> <urn:loginId>joe</urn:loginId> </urn:user> <urn:role> <urn:displayName>CR Business Analysts</urn:displayName> <urn:projectId> <urn:displayName>Change Approval Request Project</urn:displayName> </urn:projectId> </urn:role> </urn:HasUserRole>
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.