Fixes TryConvertTo with StringValues

This commit is contained in:
Shannon
2020-12-01 16:08:16 +11:00
parent e431c82edc
commit a995cdc360
2 changed files with 7 additions and 2 deletions

View File

@@ -57,7 +57,9 @@ namespace Umbraco.Web.BackOffice.Authorization
// must succeed this requirement since we cannot process it
return Task.FromResult(true);
}
userIds = ids.Select(x => x.Value.TryConvertTo<int>()).Where(x => x.Success).Select(x => x.Result).ToArray();
userIds = ids
.Select(x => x.Value.ToString())
.Select(x => x.TryConvertTo<int>()).Where(x => x.Success).Select(x => x.Result).ToArray();
}
if (userIds.Length == 0)

View File

@@ -54,7 +54,10 @@ namespace Umbraco.Web.BackOffice.Authorization
return Task.FromResult(true);
}
var intIds = ids.Select(x => x.Value.TryConvertTo<int>()).Where(x => x.Success).Select(x => x.Result).ToArray();
var intIds = ids
.Select(x => x.Value.ToString())
.Select(x => x.TryConvertTo<int>()).Where(x => x.Success).Select(x => x.Result).ToArray();
var authHelper = new UserGroupEditorAuthorizationHelper(
_userService,
_contentService,