Protected BO during process + editing

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
srufini
Posts: 31
Joined: Thu May 23, 2019 11:23 pm

Protected BO during process + editing

Post by srufini »

Hi,

I am sure this is a problem other people had, but I couldn't figure out a solution.

When I edit some BO in a form sometimes I have to call processes : e.g. mult-file upload, or add new reference + use custom implementation.

If the user uses one of these functions during editing and then tries to modify another field and then save the form I get the ERROR message

"Access to business object MY_BO is denied for Administrator"

Now, I would imagine that AwareIm could recognize that the modification is done by a process and should not trigger any protection, or that I could somewhere define that.
I thought I could solve this by changing (in the called process) the ISOLATION LEVEL. But this desn't seem to help whatever option I select.

I hope I stated my issue clearly.
Any help/hint would be highly appreciated.

Thanks!

Sergio
PointsWell
Posts: 1451
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Protected BO during process + editing

Post by PointsWell »

srufini
Posts: 31
Joined: Thu May 23, 2019 11:23 pm

Re: Protected BO during process + editing

Post by srufini »

PointsWell wrote: Tue Feb 13, 2024 9:21 am https://www.awareim.com/dokuwiki/doku.php/a_f/a/protect

See FROM ... EXCEPT
Thanks Pointswell for the quick reply.
I am not sure though if this applies to my case.
In my example the function (o.e. SYSTEM) can successfully modify the BO, but the form is still open (the function is called from the BO form) and if I modify any field AFTER I called the fuciton, then I get the error when I try to save the form.

If I use something like
PROTECT MY_BO FROM ALL EXCEPT System

In the BO rules than I would not be able to modify the BO anymore. Or Did I misunderstood the use of this commands?

Cheers

Sergio
PointsWell
Posts: 1451
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Protected BO during process + editing

Post by PointsWell »

The error you reported was
"Access to business object MY_BO is denied for Administrator"
You have run the process as "Administrator".

If you want Administrator to be able to run the process against the protected BO then you need to protect EXCEPT FOR Administrator.
srufini
Posts: 31
Joined: Thu May 23, 2019 11:23 pm

Re: Protected BO during process + editing

Post by srufini »

Hi,

no sorry I cannot explain myself clearly.
I don't want Administrator to be able to run the process against the protected BO...

I open the form (RegularUser or Administrator, no matter what)
I start a process inside the form (clicking a button) that modifies the BO (for example multi-file upload)
Then the BO has been modified by System successfully
But after this modification If I want ot continue moto modify other fields in the form then awareIM returns error because the BO was modified by System.
There must be a way to let the BO be modified by the process (started by the same user) and then by the user, isn't?

Sergio
joben
Posts: 209
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: Protected BO during process + editing

Post by joben »

Shouldn't you be getting another error message like "object was changed by another user" rather than a read protection error?
Just find it a bit strange...

Perhaps add this line to the end of the process as a workaround?

Code: Select all

VIEW BO
OR

Code: Select all

VIEW BO USING FormName
It should force reload the form.
Regards, Joakim

Image
PointsWell
Posts: 1451
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Protected BO during process + editing

Post by PointsWell »

When I edit some BO in a form sometimes I have to call processes : e.g. mult-file upload, or add new reference + use custom implementation.

If the user uses one of these functions during editing and then tries to modify another field and then save the form I get the ERROR message

"Access to business object MY_BO is denied for Administrator"

Now, I would imagine that AwareIm could recognize that the modification is done by a process and should not trigger any protection
If you run a process via the scheduler then the process owner is SYSTEM

If a user runs a process then the process owner is the user (controlled by the Admin role in your case).

You cannot PROTECT a BO and have a user modify it via a process.

You will need to readdress your protection scheme and perhaps limit your protection to the attributes that you are concerned about rather than the whole BO.
srufini
Posts: 31
Joined: Thu May 23, 2019 11:23 pm

Re: Protected BO during process + editing

Post by srufini »

ok,

thanks all for your remarks, it helped me to confirm that the what I expected as behavious was supposed to be.
I figured out where the problem was, not obvious to me.

The issue was the form refresh option


Some process were addedd as trigger to refresh and some not.
Once I added them to the list of refresh triggers, all was solved.
Makes sense but not 100% intuitive.

Also the problem was triggered by the command of deleting a BO from a list inside the form (attribute with multiple BOs). Of course there was no procress DELETE to add to the triggers, but was sufficient to add the BO type to the triggers.

I hope this post could help anyone having my same problem.

Thanks again all for the feedbacks.

Sergio
Post Reply