Is there a way to programatically set what user a function runs as
Håvar Falck-Andersen
10-21-19
When calling a webshop hal function. Is there a way to programatically set which user this function runs as ? (without the user doing a login action)
David Delač
10-30-19
Hi Håvar,

I'm sorry for the delayed response. Can you please give me example and / or function that you would like to use. We have a way of identifying logged in user and we are not able to override it in 100% of the cases so to be able to help you I will need more details on what exactly you wish to do.

Best Regards,
David D.
HansaWorld
Håvar Falck-Andersen
11-7-19
Hello David.

The idea is for someone to be able to do an action that they normally cannot perform. But as part of a workflow they may say for example ok an invoice which they normally can not.

User A have all rights

User B can only do a few things. (not ok invoice)

I want user B to be able to run a maintenance function that does several things and among them ok an invoice. This is stopped by the access system in Hansa now (something it was not before) - so my idea was to give change the privilege level of user B to user A when ok'ing the invoice and then switch back to B.

Thank you
David Delač
11-8-19
Hi Håvar,

You can find where UserCanAction("InvOK",true) is used and add additional case that would check if RecordUpdate has been called from Maintenance or not. We have primitive IsMaintenance() that can help you achieve this check.

Example of how it can be done:


if (UserCanAction("InvOK",true) or IsMaintenance) then begin
//do something

end;

Just for future reference we also have HAL Primitives website with all this information:
http://halforum.hansaworld.net/primitives/procedure/IsMaintenance

Best Regards,
David D.
HansaWorld
Swati D.
12-3-19
Hi Havar

Has the problem been resolved to your satisfaction? Can we close the request?

Swati
HW Support
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Hello, Kindly please report the bug so that we can further investigate and resolve it. Thank you. Best regards, Benjamin...
11:31 3 May 2024
Hi, No changes should have been made that would increase client's HDB file. Please try to delete HANSA.HDB from client folder and reconnect to server and check if it will grow to 30MB again. ...
10:14 30 Apr 2024