Security filter
Describe the request
The default for security filtering on explicit record variables is: Validated. This means: Any code that defines a record as a variable has to set the security filtering to Filtered. And when the Base Application uses such a record we probably cannot change the the security filtering on it. See: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/security/security-filters, "The Validated value is used mainly for compatibility with the security model in earlier versions of Business Central. We recommend that you use the other modes when you implement your security model." So, could you change the default value security filtering on explicit record variables to: Filtered?
Additional context
To use security filtering at all.
This is a very dangerous proposal and i would like to disagree.
There are so many places where user with limited access can create inconsistent data (instead of recieving a error message).
Examples:
- A lot of places use FindLast() to extract information from ledger - this will give wrong result if any security filters applied (e.g. GetMaxValuationDate in codeunit 22 "Item Jnl.-Post Line")
- A lot of processes use CalcSums to get data from ledgers - this will give wrong result if any security filters applied (e.g. CalcGLEntryShare in codeunit 1104 "Cost Account Allocation" and lead to wrong data in ledgers.
- etc.
The impact of this change is so huge, that it will be a disaster not only for the base application, but for all other extensions developed by partners.
If a certain place allows a limited access to data (e.g. a datatitem of a printable report) it should be explicitely specified.
I would like to suggest a mild version of this proposal: evaluate which standard reports allow limited access to data and change it in the base application. For example:
- report 111 "Customer - Top 10 List" - dataitem Customer
- report 5608 "Fixed Asset - Acquisition List" - dataitem Fixed Asset
- etc.
To the first example: No. Findlast will not find the last record, if the user is limited by security filters (and the last record, say, is not within this range). There will be an error because he tries to access a record he is not allowed to. There will be errors and errors and errors ...
Interesting idea! Unfortunately, this repository is only for Business Central extensibility requests or code contributions towards the 1st party Business Central apps.
For suggestions to the Business Central product group, please create a BC Idea.