Permalink
Browse files

Include Roles in [RequiresAnyRole] attribute when scanning for Roles …

…used
  • Loading branch information...
mythz committed Nov 28, 2018
1 parent afff7d7 commit c4efdfa70f140b6d4a5331bfebd5beb188b7e74d
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/ServiceStack/Auth/AspNetWindowsAuthProvider.cs
@@ -40,6 +40,13 @@ public AspNetWindowsAuthProvider(IAppHost appHost)
.SelectMany(x => x.RequiredRoles);
requiredRoles.Each(x => AllRoles.AddIfNotExists(x));
var requireAnyRoles = host.Metadata.OperationsMap
.SelectMany(x => x.Key.AllAttributes<RequiresAnyRoleAttribute>()
.Concat(x.Value.ServiceType.AllAttributes<RequiresAnyRoleAttribute>()))
.SelectMany(x => x.RequiredRoles);
requireAnyRoles.Each(x => AllRoles.AddIfNotExists(x));
});
}

0 comments on commit c4efdfa

Please sign in to comment.