0

I have a controller with an Authorize attribute on it that accepts users for the Worker role:

[Authorize(Roles = "Worker")]
public class AuthorizedController : Controller

The rest of the controllers inherit from this controller.

In one of my controllers I want to give access to authorized users that is not in any role for some actions. Is there a way to inherit from AuthorizedController and yet give access to some of the inherited controller actions for users that are not in the worker role?

GalacticCowboy
  • 11,663
  • 2
  • 41
  • 66
MikeAlike234
  • 759
  • 2
  • 12
  • 29

1 Answers1

0

Try to put the [Authorize] on the controller and the [Authorize(Roles = "Worker")] on the Action, so you can control better the authorization.

theLaw
  • 1,261
  • 2
  • 11
  • 23