StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
76 stars 31 forks source link

LC0068 Special Case for Objects with AccessByPermission #756

Open pri-kise opened 2 months ago

pri-kise commented 2 months ago
report 50000 "PTE Process Inc. Documents"
{
    AccessByPermission = tabledata "Incoming Document" = RM;
    ApplicationArea = All ;
    Extensible = false;
    ProcessingOnly = true;
    UsageCategory = Tasks;

    dataset
    {
        dataitem("Incoming Document"; "Incoming Document") //Is this warning correct?
        {           
            trigger OnAfterGetRecord()
            begin
                // DoMagic();
            end;
        }
    }
}

This example is very simplified, but I wanted to raise this issue, since I'm unsure if the information here is correct.

Should we really show this information if we intentionally set the AccessByPermission property?

StefanMaron commented 2 months ago

Good question, probably not. If I need a user to have explicit permissions on the object, Indirect permission are not sufficient anyways.

Thanks for reporting!