Web Services Developer's Guide → Web Services API Reference → SBM Administrative Web Services → Administrative Calls → HasGroupPrivilege
This service checks for a specified privilege 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. |
privilegeName (required) | string | Name of the privilege (for example, "TS_USRSYSPRIV_APIACCESS"). |
objectId | string | The ID of the object to check privileges against. |
user | GroupIdentifier | The group to check privileges against. |
options | Options | Holds name value pairing for future arguments. |
A boolean is returned, showing whether the group has the privilege (true) or not (false). The privilege is checked in the context of the specified group. For example:
<ae:HasGroupPrivilegeResponse> <ae:return>true</ae:return> </ae:HasGroupPrivilegeResponse>
You can call GetGroupPrivileges for the administrator account or for a user account (assuming it has all privileges) to return the name of every privilege. You can then use these privilege names in the HasGroupPrivilege call.
The objectId argument is used to limit the privilege check to a certain database object. For example, if want to query a table privilege, you specify the table ID of the table. If want to query a project privilege, you specify the project ID. To check for system privileges, send an empty objectID argument.
The following XML is a snippet of the payload this is sent with HasGroupPrivilege.
<urn:HasGroupPrivilege> <urn:auth> <urn:userId>bill</urn:userId> <urn:password></urn:password> <urn:hostname></urn:hostname> </urn:auth> <urn:privilegeName>TS_ADMSYSPRIV_GLOBALADMIN</urn:privilegeName> <urn:group> <urn:displayName>IM Administrator</urn:displayName> </urn:group> </urn:HasGroupPrivilege>
Copyright © 2007–2017 Serena Software, Inc. All rights reserved.