CHECKPRIVS: Retrieving the Privilege State for the Connected User

How to:

Given a privilege code, CHECKPRIVS returns the value Y, if the connected user has that privilege, or N if the user does not have the privilege or the privilege does not exist.

Note: You can see your list of general privileges by clicking the Console (C) button at the top left corner of the window and selecting My Console/Show My General Privileges. A user with Server Administrator privileges can also see the list of general privileges on the Access Control page by right-clicking a user ID, selecting Properties from the context menu and clicking the General Privileges tab on the Properties page.


Top of page

x
Syntax: How to Retrieve the Privilege State for the Connected User
CHECKPRIVS(privcode, output)

where:

privcode

Is the privilege code for which to retrieve the status.

output

Alphanumeric

Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks.



Example: Retrieving the Privilege State for the Connected User

The following request retrieves the privilege state for privilege ADPTP (Configure Data Adapter):

-SET &PRIVSTATE = CHECKPRIVS(ADPTP,'A1');
-TYPE Privilege State is: &PRIVSTATE

The output is:

Privilege State is: Y

WebFOCUS