Manage Learn to apply best practices and optimize your operations.

When is adopted authority in effect?

I changed our initial program to adopted authority and *OWNER. The Owner profile has *ALLOBJ authority. The user ran an option that submitted a job; the job generated an authority error with work files. I changed the authority of the object and the process continued. I returned the users profile to *ALLOBJ.

I thought once a program adopted authority, the owners authority was in affect until it ended.

Is there a default on the SBMJOB command that controls this?

If there is, can I change the default without recompiling all the programs that have SBMJOB's?

The key to knowing when adopted authority is in effect is to first understand that adopted authority is stack-based. Here's what happens in most cases: When a program that adopts is called (in this case your initial program), adopted authority will be in effect for as long as that program is in the program call stack. So if Program_A calls Program_B and Program_B then calls Program_C, the adopted authority is passed along to each program (as long as the Use Adopted Authority parameter is set to the default setting "*YES). Adopted authority will be in effect as long as Program_A is in the program call stack. When you do a SBMJOB, that command starts another job and, therefore, another program stack. Nowhere in this new stack does Program_A exist. In other words, adopted authority is not passed along to new jobs even though the submitting job has adopted authority. One way to solve your situation is to have the first program called by the submitted job adopt authority.

Hope this helps.


The Best Web Links: tips, tutorials and more.

Search400's targeted search engine: Get relevant information on security.

Dig Deeper on iSeries physical security

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.