The Zurich release has arrived! Interested in new features and functionalities? Click here for more

ACL issue. How to avoid creating a record based on field condition?

Zod
Giga Guru

Hey,

I created a new table. The standard ACL for creation for newly created role has been restricted on write & create for a field condition to be satisfied. 

I.E. create / write is only allowed if fieldA is not 'abc'. FieldA is a choice list. All works a expected on change/delete/write .. but anyhow when creating a new entry and setting the field value to 'abc' .. insert and submit is working an the record is created even the ACL pretents that this is not possible.

 

Sure I can run client script to remove choice field if role is not sufficient or run a business rule before insert to check the conditions .. but I like to understand why the ACL does not cover this? For me the ACL create only seems to be relevant if there are not more conditions involved. Is that true??

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

For creating we will never check fields because the record is new i.e. no in database. So this wont work.

We will always restrict is based on roles as Omkar said.

 

You can restrict submission of record if that field condition is not met in before update BR.

Thanks,
Ashutosh

View solution in original post

3 REPLIES 3

Omkar Mone
Mega Sage

Hi

I think ACL will restrict the user from allowing to read and write. For create it will only see if user has the role to create or not. It won't check if there is a conditional restriction on it then don't let it create. That won't happen via ACL. It will only allow on not allow user to create a record and thats it. 

Hope this helped. 

Let me know incase of queries.

 

Regards,

Omkar Mone.

www.dxsherpa.com

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

For creating we will never check fields because the record is new i.e. no in database. So this wont work.

We will always restrict is based on roles as Omkar said.

 

You can restrict submission of record if that field condition is not met in before update BR.

Thanks,
Ashutosh

Greg42
Mega Guru

Just to add to what they guys said. To leverage create ACL use .canCreate() check. Then your create ACL will apply.