sgoupil
17th October 2013, 15:20
Hello, I was wondering if there in a way to change user in the logic of a program script (a bit like switch.to.company). I know I could probably be able to use a unix script to do it, but if there is something directly from Baan? We are on BaanIVc4.

mark_h
17th October 2013, 15:33
May I ask why you want to change user? Not sure what you are attempting to do, but more information might result in a solution.

sgoupil
17th October 2013, 17:49
Here it is. We are automating a process were one of the session is what we call here critical and users don't all have permissions on it. So in the program, using AFS, we want to give permission to user, convert to runtime and then remove permission and reconvert to runtime. The problem is user dor not have access to ttaad2131m000 (Authorizations) and ttaad4200s000 (Convert), so, if possible we could use a generic super user in order to give the permission to the user and remove it after. Once permission is given and revoved, we switch back to current user...

bhushanchanda
17th October 2013, 19:50
Hi,

Can't you just remove the access to that session for that user and keep full authorization for that session to the user. And for further precaution you can remove his Run Program authorization as well so that he wont be able to call the session using session code.

Just a possibility you can try without going into deep.

mark_h
17th October 2013, 20:22
We used the method Bhushan outlined. Our users have DEM flows - so certain sessions do not go on the dem flow, but we grant permissions to the sessions. Then we took away run program and gave them our new version of run program. Our new version of run program only allows users to run session that are part of their dem flow.

Another thing I have done is create my own permissions session. We have sessions where some functions in the sessions are not available to all users. Only an example not what we really do - lets say I have a session with 3 buttons that call maintain items, maintain boms, maintain routings. I would add a key value for each session(right now session name), then I would add each user id that would be allowed to do that function. Then when they clicked the maintain items button I would check this table for their userid, if not found - pop up a message - no permissions.

Here is a real example - for inventory transfers I have a AFS session which allows users to enter one transaction at a time to process. For our inventory managers there is a button that says load a file. If a normal user clicks it they get no permissions, but our experienced (1 or 2 users) they could load a file with hundreds of transfers. I think we have both a bin to bin and invetory adjustments session that do the same type thing.


choice.user.0:
on.choice:
if check.user("tdudi0125s000",logname$) then
message("No permission to use this option.")
choice.again()
endif
zoom.to$("tdudi0125s000",z.session,"tdvss1120","",0)