microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
722 stars 242 forks source link

Namespaces causing issues while generating permission sets in vscode #7659

Open rickblommetjes opened 5 months ago

rickblommetjes commented 5 months ago

1. Describe the bug Based at running issue and support call not being able to upload an PTE extention due to missing permision of an table, while it was in the permisison object using for example the byreference "using easystep2.warehouse.journal;" and not the full path of the object.

The workaround for above issue was to generate the permission set with full reference to the namespaces.

However on top of that i noticed the problem when you add an object with the same name but within my namespace like easystep2.warehouse.journal and you don't have the using statement correct in the permissions like microsoft.warehouse.journal for example I have the codeunit "WMS Management" in the permission set, it will conflict with the easystep2.warehouse.journal namespace. only when putting the object in the permision object with the full namespaces it works.

image

However when generating in the permisionset object all objects like this and I update the permisionset with the following command "AL: Generate permission set as AL object containing current extention objects" it will add the objects without the Namespaces and it ignores the existing line with the full path.

2. To Reproduce Generate a permissionset object add a namespace to the permission object and add the missing namespace references with the code action using the option add full path references within this document.

image

and run the command "AL: Generate permission set as AL object containing current extention objects"

  1. Go to '...'

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior Either allways force the permissionset to be generated with the full namespace references and that at least both scenario's are recognized and it won't add new lines for lines which are allready there with the full path.

4. Actual behavior A clear and concise description of what happened accompanied by images, animations, or a link to a video showing the issue occurring

5. Versions: