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 kapitan@kepty.cz 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

Exploring CosmosDB with Business Central, part 2

Exploring CosmosDB with Business Central, part 2

This part explains how to connect to Azure Cosmos DB from your Business Central extension using AL Language and how to get some values from the database.------------------------------------------------------------------------------------------------------------------...

read more
DynamicsCon 2021 session recording available!

DynamicsCon 2021 session recording available!

Finally, recordings from DynamicsCon 2021 Autumn edition are available! Check the official youtube channel. It was a great conference with over 250 people during my live session! I definitely hope I will be able to attend the next in-person DynamicsCon as a speaker...

read more
Directions EMEA day 0 ;)

Directions EMEA day 0 😉

Directions4Partners EMEA 2021 is still in progress here in Milan. I want to share all details about each day, but unfortunately, there are so many amazing things to see, watch and try I have almost no time. So today just a few words about the day before the...

read more
ErrorInfo data type & Collectible Errors

ErrorInfo data type & Collectible Errors

A major change to AL Language development is here! Collectible errors can hugely improve any validation procedures. And what's new? Everything is about a new data type ErrorInfo. ErrorInfo data type ErrorInfo is a new data type introduced in Microsoft Dynamics 365...

read more
Working with Translation Files (XLIFF)

Working with Translation Files (XLIFF)

How does the translation file work? In Microsoft Dynamic 365 Business Central, displaying different languages is done using the XLIFF files extension (.xlf). The generated XLIFF files have strings that are specified in properties like Captions, Tooltips......

read more
Custom Filter Tokens

Custom Filter Tokens

As a user of the Business Central you have some constants you can use to filter or insert values. These constants contain useful values for data manipulation such as t / today for date field - return current dateq / quarter for date field filters - return range of the...

read more