Web Services Developer's Guide → Web Services API Reference → SBM Administrative Web Services → Administrative Calls → GetUserPrivileges
This services returns a list of privileges for a specified user.
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. |
privilegeType | string | Indicates the privilege is either a normal user privilege or an administrator privilege. The types of privilege for each are listed below. |
objectId (optional) | string | The ID of the object you wish to check privileges against. If provided, privilegeType becomes required. |
user (optional) | UserIdentifier | Indicates the user for which privileges should be returned. If this parameter is not provided, the privilege query is made against the user account that sends the call. |
Privilege is returned. The privileges are returned in the context of either the calling user or the specified user. The privilege name, type, and object UUID (if the privilege applies only to a particular object like a project or table) are returned. For more information, see Privilege.
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 you want to query a project privilege, you specify the project ID. To check for system privileges, send an empty objectID argument. If the object ID is not composed of all numeric digits, the ID is interpreted as the UUID for the object. Note that if this parameter is provided, then the privilegeType argument is required.
If an invalid privilege type or no privilege type is specified at all, the call will succeed, but no privilege information will be returned. The tables below contain the possible privilege types.
The available privilege types for a normal user are:
TS_PRIVTYPE_USERSYS |
TS_PRIVTYPE_USERPRJ |
TS_PRIVTYPE_USERWKF |
TS_PRIVTYPE_USERFLD |
TS_PRIVTYPE_USERTBL |
The available privilege types for an administrator are:
TS_PRIVTYPE_ADMSYS |
TS_PRIVTYPE_ADMPRJ |
TS_PRIVTYPE_ADMWKF |
TS_PRIVTYPE_ADMFLD_PRJ |
TS_PRIVTYPE_ADMFLD_WKF |
TS_PRIVTYPE_ADMCON |
TS_FLDPRIVTYPE_ADMFLD |
TS_FLDPRIVTYPE_ADMGRP |
TS_FLDPRIVTYPE_ADMTBL |
The following XML is a snippet of the payload that is sent with GetUserPrivileges.
<urn:GetUserPrivileges> <urn:auth> <urn:userId>admin</urn:userId> <urn:password></urn:password> <urn:hostname>localhost</urn:hostname> </urn:auth> <urn:privilegeType>TS_PRIVTYPE_USERTBL</urn:privilegeType> <urn:objectId>1003</urn:objectId> <urn:user> <urn:displayName>Bill Admin</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:loginId></urn:loginId> </urn:user> </urn:GetUserPrivileges>
Another example:
<urn:GetUserPrivileges> <urn:auth> <urn:userId>admin</urn:userId> <urn:password></urn:password> <urn:hostname></urn:hostname> </urn:auth> <urn:privilegeType>TS_PRIVTYPE_ADMCON</urn:privilegeType> <urn:objectId></urn:objectId> <urn:user> <urn:displayName>Bill Admin</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:loginId></urn:loginId> </urn:user> </urn:GetUserPrivileges>
Copyright © 2007–2016 Serena Software, Inc. All rights reserved.