Retrieve User Authority to Object (QSYRUSRA) API


  Required Parameter Group:


  Optional Parameter Group 1:

  Optional Parameter Group 2:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve User Authority to Object (QSYRUSRA) API returns a specific user's authority for an object to the caller.


Authorities and Locks

The following authorities are required for the user calling this API, unless the user profile specified is *CURRENT, the caller owns the object, or the object is an authorization list:

If previous programs in the program stack adopt their owner's authority, the adopted authority for the current program is the accumulated adopted authority from all other programs in the program stack that adopt authority. Adopted authority is only valid when the user specified is *CURRENT. If a path name is specified, adopted authority is not used when accessing the path object.

If a path name is specified, *X authority is required for each directory in the path.

If a path name is specified, adopted authority is not used to locate the object but adopted authority will be used when authority information is retrieved for the object.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable used to return the user's authority to the object. This variable must be at least 8 bytes long.

Receiver variable length
INPUT; BINARY(4)

The length of the receiver variable. The variable must be at least 8 bytes long.

Format name
INPUT; CHAR(8)

The name of the format used to return the authority information.

You can specify the following special value:


User profile name
INPUT; CHAR(10)

The name of the user whose object authority is returned.

You can specify the following special values:


Qualified object name
INPUT; CHAR(20)

The name of the object whose authority is returned. The first 10 characters specify the object name, and the second 10 characters specify the library.

If you want to use a path name instead of a qualified object name, then use this special value for the object name:

You can use these special values for the library name:


Object type
INPUT; CHAR(10)

The type of object for which authority information is returned. The object type must be blank if *OBJPATH is specified for the qualified object name.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Optional Parameter Group 1

ASP device
INPUT; CHAR(10)

The name of the auxiliary storage pool (ASP) device in which to search for the library that contains the object. If *OBJPATH is specifed for the qualifed object name, the ASP device must be *.

The valid values are:

If *CURLIB or *LIBL is specified for the library then the ASP device parameter must be specified as *.


Optional Parameter Group 2

Path name
INPUT; CHAR(*)

The object name, specified as a path name. This parameter is assumed to be represented in the coded character set identifier (CCSID) currently in effect for the job. If the CCSID of the job is 65535, this parameter is assumed to be represented in the default CCSID of the job.

If the length of the path name is -1, then this parameter is assumed to be a Qlg_Path_Name_T structure that contains a path name or a pointer to a path name. For more information on the Qlg_Path_Name_T structure, see Path name format.

Length of path name
INPUT; BINARY(4)

The length of the path name in bytes. If the length is -1, the path name parameter is assumed to be a Qlg_Path_name_T structure. This value must be zero if no path name is specified.


Receiver Variable Description

The following tables describe the order and format of the data returned in the receiver variable. For detailed descriptions of the fields in the tables, see Field Descriptions.

USRA0100 Format



Field Descriptions

Adopted authorization list management. Whether the user has adopted this authority to the object. If the user adopted the authority, this field is Y. If not, this field is N.

Adopted data add. Whether the user has adopted this authority to the object. If the user has adopted the authority, this field is Y. If not, this field is N.

Adopted data delete. Whether the user has adopted this authority to the object. If the user has adopted the authority, this field is Y. If not, this field is N.

Adopted data execute. Whether the user has adopted this authority to the object. If the user adopted the authority, this field is Y. If not, this field is N.

Adopted data read. Whether the user has adopted this authority to the object. If the user has adopted the authority, this field is Y. If not, this field is N.

Adopted data update. Whether the user has adopted this authority to the object. If the user has adopted the authority, this field is Y. If not, this field is N.

Adopted object alter. Whether the user has adopted this authority to the object. If the user adopted the authority, this field is Y. If not, this field is N.

Adopted object authority. The user's adopted authority to the object. This field is only valid if some of the user's authority is adopted. If the user does not adopt authority, this field will be blank.

If a qualified object name is specified, the possible values are:

If a path name is specified, the possible values are:

Note: If *OBJPATH is specified for the qualified object name parameter, be aware that adopted authority is not used by most commands and APIs that accept path names as input.

Adopted object existence. Whether the user adopted this authority to the object. If the user adopted the authority, this field is Y. If not, this field is N.

Adopted object management. Whether the user has adopted this authority to the object. If the user has adopted the authority, this field is Y. If not, this field is N.

Adopted object operational. Whether the user has adopted this authority to the object. If the user has adopted the authority, this field is Y. If not, this field is N.

Adopted object reference. Whether the user has adopted this authority to the object. If the user adopted the authority, this field is Y. If not, this field is N.

ASP device name of library. The auxiliary storage pool (ASP) device name where the object's library is stored. If the object's library is in the system ASP or one of the basic user ASPs, this field contains *SYSBAS.

ASP device name of object. The auxiliary storage pool (ASP) device name where the object is stored. If the object is in the system ASP or one of the basic user ASPs, this field contains *SYSBAS.

Authority source. Indicates where the authority that the user has to the object initially came from. The authority may be a combination of authority from this source plus adopted authority.

This field contains one of the following special values:

Authorization list. The name of the authorization list securing the object.

This field can contain one of the following special values:

Authorization list management. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Bytes available. The number of bytes of data available to be returned to the user. If all data is returned, this is the same as the number of bytes returned. If the receiver variable was not big enough to contain all of the data, this is the number of bytes that can be returned.

Bytes returned. The number of bytes of data returned to the user. This is the lesser of the number of bytes available to be returned or the length of the receiver variable.

Data add. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Data delete. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Data execute. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Data read. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Data update. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Group information table. A list of the user's group authorities to the object.

Number of group table entries returned. Number of group table entries returned in the receiver variable.

Object alter. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Object authority / Data authority. If a qualified object name is specifed, this is a special value indicating the user's total authority to the object including adopted authority (if the user is *CURRENT). If a path name is specified, this is a special value indicating the user's data authority to the object and includes any adopted authority (if the user is *CURRENT).

If a qualified object name is specified, the possible values are:

If a path name is specified, the possible values are:

Object existence. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Object management. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Object operational. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Object reference. Whether the user has this authority to the object. If the user has the authority, this field is Y. If not, this field is N.

Offset to group information table. Offset from the beginning of the receiver variable to the first group table entry.

Reserved. An ignored field set to hexadecimal zeros.

Some adopted authority. Whether some of the authority that the user has to the object comes from adopted authority. If some of the authority is adopted, this field is Y. If not, this field is N. This field can only contain Y if the user is *CURRENT.


Group Information Table

This table holds information about the authorities a group has to the object.



Field Descriptions

Authority source. Where the group's authority comes from. The value of this field is one of these special values:

Authorization List Management. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Data add. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Data delete. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Data execute. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Data read. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Data update. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Displacement to next group entry. Displacement to the next group entry. This field is 0 if there is not another group entry.

Group profile. Name of a group in the user's profile.

Object alter. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Object authority / Data authority. If a qualified object name is specified, this is a special value indicating the group's authority to the object. If a path name is specified, this is a special values indications the group's data authority to the object.

If a qualified object name is specified, this is one of the following values:

If a path name is specified, this is one of the following values:

Object existence. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Object management. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Object operational. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.

Object reference. Whether the group has this authority to the object. If the group has the authority, this field is Y. If not, this field is N.


Error Messages



API Introduced: V2R2


[ Back to top | Security APIs | APIs by category ]