Skip to content

Commit

Permalink
Include Roles in [RequiresAnyRole] attribute when scanning for Roles …
Browse files Browse the repository at this point in the history
…used
  • Loading branch information
mythz committed Nov 28, 2018
1 parent afff7d7 commit c4efdfa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ServiceStack/Auth/AspNetWindowsAuthProvider.cs
Expand Up @@ -40,6 +40,13 @@ public AspNetWindowsAuthProvider(IAppHost appHost)
.SelectMany(x => x.RequiredRoles); .SelectMany(x => x.RequiredRoles);
requiredRoles.Each(x => AllRoles.AddIfNotExists(x)); 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));
}); });
} }


Expand Down

0 comments on commit c4efdfa

Please sign in to comment.