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
744 stars 245 forks source link

"Table XXXX is missing a matching permission set" #1880

Closed kine closed 6 years ago

kine commented 6 years ago

I have permission set XML file in the workspace including the table, but still I have this error. How the permission set is tested? Which rules must be followed?

Having the file with this in workspace and still table 50100 have no matching permission set> image

ajkauffmann commented 6 years ago

It seems that this issue is now blocking tenant customizations with tables included for publishing on Business Central.

kalberes commented 6 years ago

This has been fixed locally but has not made the build for BC. It will be available for the first update though. Until then it should be suppressed with a custom ruleset rule.

RobAnderson42 commented 6 years ago

To clarify, we did take this fix for Business Central, so it shouldn't be blocking tenant customizations. The fix will be available in Visual Studio Code in the next update.

paulcart commented 6 years ago

I'm still seeing this issue when trying to deploy an extension to Business Central trial tenants using the "Upload an Extension" function. At the moment this means we can't deploy any tenant specific extensions that contain new tables. I'm aware that the bug still exists in VSCode, but we're still seeing it in BC.

hemisphera commented 6 years ago

I hate to hijack this issue for my question but ... How the heck did you get this XML structure out of Business Central? I have spent an entire day now trying to figure this out and get my permission sets included in my app. I took me long enough to actually produce the output from XMLport 9171 and 9172 (they are not linked anywhere in Business Central application right now). Now that I have those files I face the same issue as #2005. Are those XMLports even meant to still be used or I am supposed to write the XML "manually"?

kine commented 6 years ago

PowerShell... ;-) https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/mt584153(v=nav.90)

waldo1001 commented 6 years ago

I hate doing this with PowerShell:

I just created a xml-snippet as part of my extension: https://marketplace.visualstudio.com/items?itemName=waldo.crs-al-language-extension

paulcart commented 6 years ago

Is anyone else still seeing this issue in BC? I'm uploading an app with a permission set, the permission set is available in BC, and has the correct tables as permissions. However my user doesn't have permissions to those tables?

doivosevic commented 6 years ago

@paulcart when compiling, does it say in the output that the file was recognized as a permission set xml?

paulcart commented 6 years ago

@DominikDitoIvosevic yep, and when it published to BC the permission set is created (as a Tenant Permission Set) with all the correct permissions. My user account has SUPER, but even if I apply the apps specific permission set I still get no permission to the tables.

It feels like it might be a licence issue as opposed to permissions?

doivosevic commented 6 years ago

@paulcart I'm not that familiar with how permissions work. Could you please provide us with repro steps?

waldo1001 commented 6 years ago

@paulcart , if you are super, you have all rights possible. So if you are still not able to access whatever you put in the permission-xml, then it's most probably a license issue indeed. Permission do not override licenses.

sbuescher commented 6 years ago

I had the same issue. Since today it seems to be fixed, right?

StanislawStempin commented 6 years ago

If you are still having this issue, could you please open a support ticket? We believe that code-wise the relevant bugs have been fixed but some tenants might not have the fix applied yet and support will assist in finding the exact state of your tenant.

paulcart commented 6 years ago

Hi, it's working perfectly today, so it must've just been my tenant was waiting for the fix. Thanks for your help!

shortcreeker commented 6 years ago

I have developed an extension that adds a new table using the "Microsoft Sandbox" and I am getting this "Table XXXX is missing a matching permission set" error when I try to deploy the App to a live client. (it deploys fine to the SandBox) I do not have a permission.xml file. Where do I find this file if I am using the Sandbox and cannot run a Power-Shell command?

waldo1001 commented 6 years ago

I added snippets for that in the CRS AL Language Extension. Just install that vscode extension, create an xml file and use the snippet...

shortcreeker commented 6 years ago

Waldo,

Thanks for creating this extension! I have in installed. I have created an extension that include a Table 50100 JobPlanSetStatus

What would the vales in the xml file need to be for RoleID, RoleName, ObjectType and ObjectId?

Thanks

shortcreeker commented 6 years ago

How do I retrieve a list of RoleID's and RoleNames's from the Sandbox?

shortcreeker commented 6 years ago

When I turn on the al.enableCodeAnalysis then I get this error, with this set to false the App still will not upload to a live D365BC Client, what am I missing?
permissions table error

waldo1001 commented 6 years ago

It's not a valid xml for permissionsets. check this:

<PermissionSets>
  <PermissionSet RoleID="SomeRoleId" RoleName="Some Role Name">
    <Permission>
      <ObjectType>TableData</ObjectType>
      <ObjectID>50100</ObjectID>
      <ReadPermission>Yes</ReadPermission>
      <InsertPermission>Yes</InsertPermission>
      <ModifyPermission>Yes</ModifyPermission>
      <DeletePermission>Yes</DeletePermission>
      <ExecutePermission>No</ExecutePermission>
      <SecurityFilter />
    </Permission>
  </PermissionSet>
</PermissionSets>
shortcreeker commented 6 years ago

I entered exactly like you recommended, then saved all files. Does it matter what role I use? I am still getting the same error.... However, when I set "al.enableCodeAnalysis" : false, and then upload the file it installs to the live client. screen1

TheDenSter commented 6 years ago

ObjectType 0 and 0/1 values for the permissions are absolutely valid. It's how the Cmdlet exports it from NAV, and at least one of our customers' app is currently live in AppSource with a permission set like that.

waldo1001 commented 6 years ago

@TheDenSter is right.

It actually should all work. but I realized I had to restart my VSCode to have the code analyzer realize it is a correct file. It did just compile and work though.

I tried:

<PermissionSets>
    <PermissionSet RoleID="SomeRoleId" RoleName="Some Role Name">
        <Permission>
            <ObjectType>TableData</ObjectType>
            <ObjectID>50100</ObjectID> 
            <ReadPermission>Yes</ReadPermission>
            <InsertPermission>Yes</InsertPermission>
            <ModifyPermission>Yes</ModifyPermission>
            <DeletePermission>Yes</DeletePermission>
            <ExecutePermission>0</ExecutePermission>
            <SecurityFilter />
        </Permission>
    </PermissionSet>
</PermissionSets>

and

<PermissionSets>
    <PermissionSet RoleID="SomeRoleId" RoleName="Some Role Name">
        <Permission>
            <ObjectType>0</ObjectType>
            <ObjectID>50100</ObjectID> <!-- SomeTable -->
            <ReadPermission>1</ReadPermission>
            <InsertPermission>1</InsertPermission>
            <ModifyPermission>1</ModifyPermission>
            <DeletePermission>1</DeletePermission>
            <ExecutePermission>0</ExecutePermission>
            <SecurityFilter />
        </Permission>
    </PermissionSet>
</PermissionSets>

I was able to publish both of them to business central.

I used my snippet "tpermissionsetcollection" image

TheDenSter commented 6 years ago

Of course I'm right ;) Great snippet by the way, you're just full of handy ideas :)

doivosevic commented 6 years ago

We have just the snippet for you :) available in our Developer preview

image

aproehl79 commented 6 years ago

@Waldo: I have the same issue like @shortcreeker. The bug is closed but i see no solution. VsCode always says "Table 'XXXXX' is missing a matching permission set. I have a valid PermissionSet.xml (created with the snippets from you) and the version of the vscode extension is "0.15.18771".

I used number range 79400..79499.

shortcreeker commented 6 years ago

I still get the error in VS Code, however the file properly imports to a live client.

On May 28, 2018, at 7:24 AM, Andreas Pröhl notifications@github.com<mailto:notifications@github.com> wrote:

@waldohttps://github.com/waldo: I have the same issue like @shortcreekerhttps://github.com/shortcreeker. The bug is closed but i see no solution. VsCode always says "Table 'XXXXX' is missing a matching permission set. I have a valid PermissionSet.xml (created with the snippets from you) and the version of the vscode extension is "0.15.18771".

I used number range 79400..79499.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/AL/issues/1880#issuecomment-392526131, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AlY1rchg8eI05uNTEaj9brHV79YWfUZKks5t2_p2gaJpZM4S_zSH.

waldo1001 commented 6 years ago

@shortcreeker , I found that 0.15.18771 is not the one where it is fixed. I have the problem there as well - although this is the current version online.

I also have an insider version (0.16.14305) and it's fixed there:

image

JosepPages commented 6 years ago

I get the same error. When will the version (0.16.14305) be in Marketplace? Thanks.

waldo1001 commented 6 years ago

@JosepPages , just that you know - for the time being, you could "bend the rule" by overruling with your own coderule.

I described it here: http://www.waldo.be/2018/03/26/enable-the-updated-code-analysis-for-al/

It is no solution, I know, but as far as I know, it will create your permissionset with deployment, and this is merely a problem with the codecop.

JSebastianN commented 6 years ago

I use the PerTenantExtensionCop analysis Ruleset and get the error: id": "PTE0004", "Table '6181276' is missing a matching permission set."

I have created a Permission.xml file - but it does not relieve me of the errors. I am using AL Language version 0.15.18771

Should I just be using a newer (Development) build of AL Language?

waldo1001 commented 6 years ago

did you restart VScode? - something that's necessary ...

waldo1001 commented 6 years ago

@JSebastianN , as I said above, I found that 0.15.18771 is not the one where it is fixed. I have the problem there as well - although this is the current version online.
Can you test with a later build?

JSebastianN commented 6 years ago

I have just downloaded 2018 CU6 with AL Language 0.12.17091

Also I should now have access to the Daily BC Docker Build, so perhaps this includes a better Error message when uploading the Extension to BC.

I will keep you updated

JSebastianN commented 6 years ago

1) The daily BC Insider build Docker, will not let my F5 Run my app

[2018-06-22 09:40:12.69] Sending request to http://dyn365bc:7049/nav/dev/apps?SchemaUpdateMode=synchronize
[2018-06-22 09:40:20.93] Error: An internal error has occurred

However, the Extension does get installed - it seems, it shows up on the Extension page. But not available in Search... Very weird.

When I try to Upload the .app in web client

External Deployment is not enabled. Please contact your system administrator.

2) I have updated my VS Code with 2018 CU6 with AL Language 0.12.17091 "Extension" Now, the Code Analysis is not supported. "al.codeAnalyzers" : ["${AppSourceCop}","${PerTenantExtensionCop}"],

-- I think I will make a reduced version of our app and add object until the validation fails to identify the problem.

Or ask the Yammer Group