anzwdev / al-code-outline

AL Code Outline for Visual Studio Code
MIT License
51 stars 14 forks source link

Allow setting for adding indirect permissions instead of direct permissions with quick fix add permissions #608

Open tkroes opened 3 months ago

tkroes commented 3 months ago

In the preview version of the Business Central LinterCop by Stefan Maroń there is a new rule to ensure that table data has the correct indirect permissions in an object. Ideally the permissions added to comply with this rule would be indirect, but currently this extension only adds direct permissions (using the light bulb/"quick fix" on an object's name to add table permissions) without option to change it to indirect. I think adding a setting for this, and defaulting it to direct permissions in order to not break existing workflows, would be ideal to solve this problem for us.

guidorobben commented 1 month ago

Or add an extra options. ' Add indirect permissions to all object...'.

ernestasjuska commented 1 month ago

Also replace old indirect permissions if those exists.

This

Permissions = 
        tabledata "Cust. Ledger Entry" = r;

becomes

Permissions = 
        tabledata "Cust. Ledger Entry" = Rr;

Which gives this compiler error: {C266DA26-7CA7-47EB-A6FE-D9DF805F6372}

And then we have this mess in BC25... image

Personally, I would prefer indirect permissions as default because most of our converted/new code uses those and changing them to direct will add unnecessary changes to Git diff. AFAIK, choice of direct/indirect permissions should not matter since the AL code in procedures and triggers will only use indirect permissions.

cegekaJG commented 2 weeks ago

Agreed, both the option to quick fix and add missing permissions on an editor and project scale with a command are crucial to quickly address the notice.

Also replace old indirect permissions if those exists.

This

Permissions = 
        tabledata "Cust. Ledger Entry" = r;

becomes

Permissions = 
        tabledata "Cust. Ledger Entry" = Rr;

I don't really understand why you would want that - wouldn't that mean that indirect permissions would never be allowed?