Check Document Library Object (CHKDLO)

The Check Document Library Object (CHKDLO) command verifies that an object exists and that a user has authority to the object before trying to access it.

These checks can be particularly useful before the user tries to access several objects simultaneously. The CHKDLO command is also used to check the validity of object names contained in CL variables and to verify object authorizations under program control.

When the command runs, the system searches for the specified object. If the object is found, the system verifies that the user is authorized to that object as specified on the CHKDLO command. If the object is not found or the user does not have the authority specified on the CHKDLO command, an escape message is sent to the user.

When the CHKDLO command is used in a CL program, the Monitor Message (MONMSG) command follows the CHKDLO command to monitor for messages that result from running this command.

Parameters

Keyword Description Choices Notes
DLO Document library object Character value, *SYSOBJNAM Required, Positional 1
FLR Folder Character value, *NONE Optional, Positional 2
SYSOBJNAM System object name Name Optional, Positional 3
OBJTYPE Object type *ANY, *DOC, *FLR Optional
AUT Authority *NONE, *ALL, *CHANGE, *USE, *EXCLUDE Optional
USRID User identifier Single values: *CURRENT
Other values: Element list
Optional
Element 1: User ID Character value
Element 2: Address Character value

Document library object (DLO)

Specifies the document library object that is checked.

This is a required parameter.

name
Specify the name of the library document or folder that is checked.
*SYSOBJNAM
The system object name is used to identify the document or folder that is checked. This parameter must be used to check a document that is not in a folder and may be used instead of a folder name or document name when the system object name is known. The SYSOBJNAM parameter and DLO(*SYSOBJNAM) must be specified together.

Folder (FLR)

Specifies the name of the folder containing the document or folder being checked.

*NONE
The object that is checked is not contained in a folder.
name
Specify the name of the folder that contains the document or folder that is checked. A folder name can be specified only if a folder or document name is specified on the DLO parameter.

System object name (SYSOBJNAM)

Specifies the system object name of the object that is checked.

name
Specify the system object name of the document or folder that is checked. A system object name must be specified if DLO(*SYSOBJNAM) is specified.

Object type (OBJTYPE)

Specifies the type of Document Library Object being checked. OBJTYPE(*DOC) cannot be specified when a document or a folder name is specified on the DLO parameter and FLR(*NONE) is also specified.

*ANY
The object that is checked can be either a document or a folder.
*DOC
The object that is checked is a document.
*FLR
The object that is checked is a folder.

Authority (AUT)

Specifies the type or kind of authority that is checked.

*NONE
Authority is not checked.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.

User identifier (USRID)

Specifies the user ID and address of the user for whom the object is being checked. If a user ID and address of someone other than the user who is signed on is specified, the user must have all object (*ALLOBJ) special authority or both users must be enrolled in the system directory and the user who is signed on must be granted permission (using the GRTUSRPMN command) to work on behalf of the specified user. Specifies the user ID and address of the user checking the object.

Single values

*CURRENT
The object is checked on the behalf of the user who is signed on the system. The user must be enrolled in the system directory or have *ALLOBJ special authority.

Element 1: User ID

user-ID
Specify the user ID of the user on whose behalf the object is checked.

Element 2: Address

address
Specify the address of the user on whose behalf the object is checked.

Note: If a user ID and address for someone other than the user who is signed on the system is specified, the user must have *ALLOBJ special authority, or both users must be enrolled in the system directory and the user who is signed on the system must be granted permission (by using the GRTUSRPMN command) to work on behalf of the specified user. This parameter is useful only when an AUT value other than *NONE is specified.

Examples

CHKDLO   DLO(FLR1)  OBJTYPE(*ANY)  AUT(*NONE)
         USERID(USER1 ADDR1)

This command checks for the existence of a folder named FLR1 on behalf of a user whose user ID is USER1 and whose address is ADDR1. The user's authority to FLR1 is not checked.

Error messages

*ESCAPE Messages

CPF8A11
CHKDLO command failed.
CPF8A75
Not authorized to access folder &1.
CPF8A77
Folder &1 not found.
CPF8A82
Document &2 not found in folder &1.
CPF8A83
Not authorized to access document &2 in folder &1.