× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Roger Mackie wrote on 04/03/2007 07:50:25 AM:

I am working on a project to give a specific user (LMTUSR) limited
access to our database. As currently designed, LMTUSR is excluded from
all but one library. The external stored procedures (SQLRPGLE and RPGLE)
in that library adopt the owner's authority to access functions and data
in other libraries. As long as those functions are in modules that only
read the data, they work fine. However, the project requires procedures
to insert data in certain tables that have *BEFORE *INSERT and *BEFORE
*UPDATE external triggers.

From reading the security reference manual (we are on v5r3) I understand
that triggers do not adopt authority from programs earlier in the call
stack. Changing the external trigger programs to adopt authority (CHGPGM
PGM(EXTTRG) USRPRF(*OWNER)) did not allow LMTUSR to open the files for
update using adopted authority. When the triggers are disabled, UDFs
that access the files complete correctly. When the triggers are enabled,
the process fails with SQL0443 and CPF4236 "Not authorized to open.." in
the job log. I could not find a parameter on the ADDPFTRG command to
adopt authority.

Did I miss something? While using adopted authority is there a way to
insert and/or update data into files with triggers? If not, I'll
probably use a data queue to get the data to a job whose user does have
authority. Or is there a better way?

Trigger programs, like most exit programs, do not use the adopted authority
of programs above it in the call stack. If the trigger program needs more
authority you can change it to adopt its own owners authority. If after
using CHGPGM USRPRF(*OWNER) for the trigger program it still fails for
these limited users then it probably means that the owner of the trigger
program does not have sufficient authority to open the file. One way to
solve that program is to change the trigger program to be owned by the same
user profile that owns the files.

Ed Fishel,
edfishel@xxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.