We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Setting field rights using userpreferences, hiding field gives sentry error on save

Hello,

At a customer want to hide some fields for certain usergroups, we do this by using the userpreference field rights system.

Example:

prefsection: Rights-person-Existing

prefkey: udpersonsmall.double05

level: 4

owner_id: usergroup id

value: 0, No access

This works, it hides the field in CRM, but when a value is set in the field, the following error occurs on save:

(which actually hides the sentry error)

If you do the same on contact level, you get the following error:

When the field is empty no error occurs.

Seems like the system is trying to save an field it does not have access to. Is there any other standard way to hide more fields for some usergroups, and make them editable for others?

 

Tested with the following field types: long, double, string

Tested on the following entity's: contact person

Versions tested: 8.5 R15, 9.1 SOD

RE: Setting field rights using userpreferences, hiding field gives sentry error on save

Hello,

After some troubleshooting this only happens for userdefined fields, it looks like there isn't a check before writing UD fields if the user has any write rights on it.

We solved this for now by using NetServer scripting to remove fields from the UserDefinedFields property that the user does not have write access on, which isn't the most 'sustainable' solution, but the only way for us to be able to solve this and enable the customer to only have fields readable and editable for specific usergroups.

Will be registering this as a bug.

By: David Hollegien 24 Jun 2020