OrchardCore: Admin menu: unable to set Permission over item from recipe
Hi All,
I have created and admin menu with this item:
{
"$type": "OrchardCore.AdminMenu.AdminNodes.LinkAdminNode, OrchardCore.AdminMenu",
"LinkText": "Libreria Multimediale",
"LinkUrl": "Admin/Media",
"IconClass": "far fa-images",
"UniqueId": "[js:uuid()]",
"Enabled": true,
"Text": null,
"Id": "media-first-level",
"Href": null,
"Url": null,
"Position": null,
"LinkToFirstChild": true,
"LocalNav": false,
"Culture": null,
"Resource": null,
"Items": [],
"RouteValues": null,
"Permissions": [{ "name": "ManageMediaContent" }],
"Classes": ["media-first-level"]
}
but when I run my recipe I receive this error:
2020-10-15 19:09:54.6967|Default||1b4aa20d-49cd3a81eecc7d6b.||Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware|ERROR|An unhandled exception has occurred while executing the request. Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type OrchardCore.Security.Permissions.Permission. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path '[0].MenuItems[9].Permissions[0].name'.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (19 by maintainers)
can I push other code modifications to the PR in the same way used yesterday? Thank you
You can checkout this branch on your fork then create a PR targetting this branch instead of the dev branch. I will close this PR afterward.
You can now fix it on top of https://github.com/OrchardCMS/OrchardCore/tree/skrypt/admin-menu-permissions