Does ACL override UI Action?

xiaix
Tera Guru

I have a table:   u_wfh_equipment_order_list

On that table, I have a true/false field: u_sent_to_end_user

The field is dictionary set to read-only, and, this ACL to only allow admins to alter:

find_real_file.png

Here's the rub though... on the form, I have a UI Action:

find_real_file.png

Will this g_form.setValue() fail due to the ACL if a non-admin clicks the Send to End User button?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi David,



I'm not seeing any real reason to include the client script code. You could make this much simpler by simply setting the values all in server code, doing the update and redirect.



current.u_sent_to_end_user = true;


current.state = 2;


current.update();


action.setRedirectURL(current);



In this scenario, the record will get updated despite the ACLs or dictionary 'read-only' attribute. That's because the server code is running at the system level and needs to have access to update those fields as scripted.


View solution in original post

4 REPLIES 4

Chuck Tomasi
Tera Patron

Hi David,



I'm not seeing any real reason to include the client script code. You could make this much simpler by simply setting the values all in server code, doing the update and redirect.



current.u_sent_to_end_user = true;


current.state = 2;


current.update();


action.setRedirectURL(current);



In this scenario, the record will get updated despite the ACLs or dictionary 'read-only' attribute. That's because the server code is running at the system level and needs to have access to update those fields as scripted.


So I can change this:


find_real_file.png




To this:



find_real_file.png




Correct?


Oops.. I meant this:


find_real_file.png


That looks about right (making some assumptions about your requirements of course.)