× 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.



Justin,

The process should work something like this:

1) Get the profile handle of the user you're CURRENTLY running under. (Don't try to do this after you've swapped, you might have an authority issue.) Save this in a variable.

2) Get the profile handle of the user you're swapping to.

3) Swap to the handle from #2.

4) Do the work.

5) Swap to the profile from #1 (swap back). Since you got the profile handle before swapping, this should not have any authority issues.

6) Release the profile handles.


The issue you mention typically happens when you don't get the original user's profile handle until after you've swapped. In that case, the swapped-to user must have authority to the original user profile, which can be problematic. It's much better to get both profile handles before doing any swapping.


On 10/11/2013 8:12 AM, Justin Taylor wrote:
I tested it using adopted authority. The first swap worked fine but the swap back failed because of an authority failure.

-----Original Message-----
From: Charles Wilt [mailto:charles.wilt@xxxxxxxxx]
Sent: Thursday, October 10, 2013 11:07 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Authority on Java calls

On Thu, Oct 10, 2013 at 9:47 AM, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:

I guess it's pick-your-poison. If swapping, the application profile
would need either *ALLOBJ or explicit authority to every profile that
would be running the app.


Justin,

You're misunderstanding something I think. With swapping, the program doing the swapping can use adopted authority to gain the authority needed to swap to another profile. The only danger is as Scott points out, you need to make sure that there's no way to exit the program without swapping back.

Charles



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.