Custom In-Line Edit

Currently, our programs allows users to edit certain fields in a table. We would like the ability to disable the ability to edit a field data based on another fields data. Similar to the way the display if/then rules work.

Example:

If Field 2 = “1234” then Field 1 is viewable and editable by all users (employees and admin)

If Field 2 = “6789” then Field 1 is viewable by all but only editable by Admin users.

The settings for inline editing are either off or on but there’s no way to customize this feature similar to the way you can in the display rules.

Any and all help with this including a custom code would be appreciated.