Command reference / sec
CHGOBJOWN
Change Object Owner
Transfers ownership of an object from one user to another. The authorities other users have to the object are not changed. The owner always has all applicable authorities unless they are explicitly revoked, and can grant any authority to any user, including to themselves. A user with *ALLOBJ special authority can transfer ownership of any object in the QSYS.lib file system, as can a user authorized to the QIBM_DB_SECADM function, though QIBM_DB_SECADM users cannot transfer ownership to themselves unless they have the required authorities. All users have add and delete authority for their own user profiles, so they can add or delete objects they created by transferring ownership.
Allowed environments: *ALL.
Positional parameters: 3.
Restrictions
- To transfer ownership, any user, including the present owner, must have object existence (*OBJEXIST) authority to the object, except for an authorization list.
- Object operational (*OBJOPR) and *OBJEXIST authorities are needed if the object is a file, library or subsystem description.
- An authorization list requires *ALLOBJ special authority or ownership.
- The new owner's user profile requires add (*ADD) authority, and the present owner's user profile requires delete (*DLT) authority.
- Changing the owner of a program or SQL package that adopts its owner's authority requires both *ALLOBJ and *SECADM special authorities.
- Use (*USE) authority to the auxiliary storage pool device is required if one is specified.
- For display stations not run from the device or its message queue, precede the command with ALCOBJ and follow it with DLCOBJ.
- Object types *DOC and *FLR cannot be specified; use DLO support for those.
- Changing the ownership of an object with an authority holder also changes the ownership of the authority holder.
Parameters
OBJ
Object
Specifies the object to be assigned to a new owner. A library name can be given to make sure the correct object changes ownership. This is a required parameter.
*LIBL- All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB- The current library for the thread is searched; if none is specified, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Object
Object
Library
Library
Suggested / special values:
*LIBL, *CURLIB
OBJTYPE
Object type
Specifies the object type of the object whose ownership is to be changed. The page lists many object type values without defining each one here; see the Commonly used parameters topic it references. This is a required parameter.
Allowed values:
*ALRTBL, *AUTL, *BNDDIR, *CFGL, *CHTFMT, *CLD, *CLS, *CMD, *CNNL, *COSD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *CTLD, *DEVD, *DTAARA, *DTADCT, *DTAQ, *EDTD, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IMGCLG, *IPXD, *JOBD, *JOBQ, *JRN, *JRNRCV, *LIB, *LIND, *LOCALE, *M36, *M36CFG, *MEDDFN, *MENU, *MGTCOL, *MODD, *MODULE, *MSGF, *MSGQ, *NODGRP, *NODL, *NTBD, *NWID, *NWSCFG, *NWSD, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PRDDFN, *PRDLOD, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *S36, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SQLXSR, *SRVPGM, *SSND, *SVRSTG, *TBL, *TIMZON, *USRIDX, *USRPRF, *USRQ, *USRSPC, *VLDL, *WSCST
NEWOWN
New owner
Specifies the user profile of the new owner for the object. The user profile must exist when this command runs. This is a required parameter.
ASPDEV
ASP device
Specifies the auxiliary storage pool (ASP) device name where the library containing the object is located. Needed if that library is in an ASP outside the job's library name space.
Suggested / special values:
*, *SYSBAS
*- The ASPs in the job's library name space are searched, including the system ASP, all basic user ASPs and, if the job has an ASP group, its independent ASPs.
*SYSBAS- The system ASP and all basic user ASPs are searched; no independent ASPs are searched.
CUROWNAUT
Current owner authority
Specifies whether the authorities for the current owner are revoked when ownership changes.
Allowed values:
*REVOKE, *SAME
*REVOKE- The current owner's authority is revoked when the object ownership changes to the new owner.
*SAME- The current owner's authority is retained as a private authority to the object.
Examples
CHGOBJOWN OBJ(USERLIB/PROGRAM1) OBJTYPE(*PGM) NEWOWN(ANN)
Assigns ownership of program PROGRAM1 in library USERLIB to user ANN and revokes the current owner's authority.
Generated from os/cl/catalog/CHGOBJOWN.json and os/cl/help/CHGOBJOWN.json.