Check User Authority to an Object (QSYCUSRA) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Check User Authority to Object (QSYCUSRA) API provides an indication of whether the user has the specified authority to an object.


Authorities and Locks

The following authority is required for the user calling this API, unless the user profile name parameter is *CURRENT or the name of the profile that is currently running, the caller owns the object, or the object is an authorization list:

If the user profile is *CURRENT or the name of the profile that is running currently, the authority to the user includes any authority specified on the object (private, group, authorization list, or public) plus any program adopted authority. If the user profile is not *CURRENT or the name of the profile that is running currently, the authority available to the user is the authority specified on the object.

Adopted authority is authority given to the user by the program for the duration of that program. 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.


Required Parameter Group

Authority indicator
OUTPUT; CHAR(1)

Whether the user has the specified authority to the object. The field contains one of the following:


User profile name
INPUT; CHAR(10)

The name of the user whose authority is checked.

You can specify the following special value:


Qualified object name
INPUT; CHAR(20)

The name of the object whose authority is checked. The first 10 characters specify the object name; the second 10 characters specify the library. You can use these special values for the library name:


Object type
INPUT; CHAR(10)

The type of object whose authority is checked.

Authority
INPUT; CHAR(*)

The authority to check for. This parameter can contain up to eleven 10-character fields. The following identifies the type of authority the user has to the object:


Number of authorities
INPUT; BINARY(4)

The number of authorities specified in the authority parameter. You can specify 1 through 11 authorities.

Call level
INPUT; BINARY(4)

The number of call levels to back up in the program stack to do the authority check. For example, if the program that calls this API adopts authority, you would probably not want the authority check to use the adopted authority. Therefore, the authority check should be done at the call level previous to the current level. This parameter should then contain a 1. You can check the authority at the various call levels by signifying a numeric equivalent to the call level. For example, to check the authority at the current call level, specify a 0; to check the authority at the previous call level, specify a 1.

This parameter is only used if the user profile name parameter is *CURRENT or the current user for the job.

Error code
I/O; CHAR(*)

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


Error Messages



API introduced: V2R2

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