Field Level Permissions (Restricted Fields)

by Jul 18, 2021AL Language, Projects

Home 9 Development 9 AL Language 9 Field Level Permissions (Restricted Fields)

I just add a new project to my GitHub repositories. It is a new extension for Business Central that extends security functionalities with field-level permission. Using this extension, users are able to define who can or can not change specific fields in any table in your system.

Source codes can be found on GitHub – https://github.com/TKapitan/TKA001-FieldLevelPermissions

Warning: Since 01.07.2021 all my new projects are available under Creative Commons Attribution-NonCommercial-ShareAlike (CC-BY-NC-SA) license. Under this license, the source codes are available for everybody for non-commercial purposes. If you would like to use any part of the code licensed under this license for commercial purposes, don’t hesitate to get in touch with me at [email protected] to discuss further details. It is possible to use my examples for commercial purposes at no cost if agreed in writing. More details about a new licensing are HERE.

Restricted Fields

The configuration can be found as “Restricted Fields”. You can specify the table/field that we want to restrict for some users on this page.

The field “Type” specify what is or is not allowed. The standard values are “Block All Changes” and “Allow Insert”. The first one does not allow to change from/to any value. “Allow Insert” allows to change the value from the blank value to any other value. If the field was not empty, the user is not able to change the value.

“Default Action” specify whether the default action is that anybody can change the value except specific users (“Default Action” = Allowed) or nobody except specific users can change the value (“Default Action” = Blocked).

The rule is active only when Enable is true.

Restricted Field Users

On the page “Restricted Fields”, we can also specify exceptions for the specific record. This can be done using the “User and User Groups” action.

We can specify a user or user group who can or can not change the field specified on the Restricted Field record on this page. Only enabled records are evaluated.

Evaluation order

The exceptions are evaluated in the following order.

  1. Is Blocked for User Group?
  2. Is Allowed for User Group?
  3. Is Blocked for User?
  4. Is Allowed for User?

The last matching rule is used (= if the field change is blocked for all users from group ABC, but it is allowed for user XYZ who is a member of ABC, the user still can change the value of the field even if his group can not).

Recent Articles from the category

BC Open Source? How to start?

BC Open Source? How to start?

BC Open Source? How to start? One of the most exciting news introduced last month in Lyon during Directions EMEA 2023 was the changes to the open-source initiative. This means that you can now contribute to the source code of the Base app and the System app, which are...

read more
Validate a FlowField Field. Wait? What?

Validate a FlowField Field. Wait? What?

Validate a FlowField Field. Wait? What? There are not many things in the AL Language that surprised me. However, last week, I found one such thing - I reviewed customizations made by another partner and had to analyze the OOTB code of the Demand Forecast matrix. I run...

read more
Dynamics NAV 2013 & Expired Cronus License

Dynamics NAV 2013 & Expired Cronus License

We found an interesting problem - we were not able to run the development environment for Dynamics NAV 2013. Whenever we tried to run the development client, we got the following error message: "Your program license has expired" and the development client has closed...

read more
Indirect Dependencies and Access Modifiers

Indirect Dependencies and Access Modifiers

Last week, there was a discussion on Yammer on how to get values from the "Sent Email" record when all fields are marked as Internal. I was surprised that many people do not know what can/can't access modifiers (such as local, protected, or internal) be used for. I...

read more
AL Extensions: Replace Document Attachment

AL Extensions: Replace Document Attachment

I have published a new simple, open-source extension that allows replacing existing document attachments in all master entities as well as in open documents. The source code as well as the app file that can be installed in your environment is available on my GitHub...

read more

Sign Up for News

Certifications

Highest certification
Microsoft Data Management and
also in D365 Business Central

Microsoft Certified: Dynamics 365 Business Central Functional Consultant Associate

See other certifications here