Skip to content

Commit 7765acb

Browse files
Merge pull request umbraco#124 from AndyButland/wip-u4-2759
U4-2759 - member authorise attribute was not restricting for group
1 parent 5640daf commit 7765acb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Umbraco.Web/Security/WebSecurity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ public bool IsMemberAuthorized(
7070
var allowGroupsList = allowGroups as IList<string> ?? allowGroups.ToList();
7171
if (allowAction && allowGroupsList.Any(allowGroup => allowGroup != string.Empty))
7272
{
73-
// Allow only if member's type is in list
73+
// Allow only if member is assigned to a group in the list
7474
var groups = Roles.GetRolesForUser(member.LoginName);
75-
allowAction = groups.Select(s => s.ToLowerInvariant()).Intersect(groups.Select(myGroup => myGroup.ToLowerInvariant())).Any();
75+
allowAction = allowGroupsList.Select(s => s.ToLowerInvariant()).Intersect(groups.Select(myGroup => myGroup.ToLowerInvariant())).Any();
7676
}
7777

7878
// If specific members defined, check member is of one of those
7979
if (allowAction && allowMembers.Any())
8080
{
81-
// Allow only if member's type is in list
81+
// Allow only if member's Id is in the list
8282
allowAction = allowMembers.Contains(member.Id);
8383
}
8484
}

0 commit comments

Comments
 (0)