Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V8: Fix node permissions YSOD (mapping issue) #5176

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Apr 6, 2019

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes #5171

Description

See #5171 for details on the issue and how to replicate it. It's a side effect of #5087 - the UserGroup ID must be included when mapping UserGroup to AssignedUserGroupPermissions, otherwise things break 😄

Testing this PR

Testing this PR is simple... if you can open the permissions dialog for an item in the content tree, the fix works 😆

@@ -167,6 +167,7 @@ private void Map(IUserGroup source, UserGroupBasic target, MapperContext context
// Umbraco.Code.MapAll -Udi -Trashed -AdditionalData -Id -AssignedPermissions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the -Id here: the // Umbraco.Code.MapAll comment triggers a Roslyn Analyzer (that is included via NuGet) that verifies that all target fields are assigned a value - except those that are excluded with a -Value comment. So... Id was excluded, quite probably because AutoMapper did exclude it too. How did it get mapped, then? No idea.

Going to merge the PR - and then to remove the -Id in the comment, if we do want it to be mapped.

@zpqrtbnk zpqrtbnk self-assigned this Apr 6, 2019
@zpqrtbnk zpqrtbnk merged commit 9c06ef8 into umbraco:v8/dev Apr 6, 2019
@kjac kjac deleted the v8-fix-map-usergroup-assignedusergrouppermissions branch April 6, 2019 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trying to access Permissions on a node throws an exception
3 participants