I have a controller like this:
[Authorize(Users="Admin")]
public class MyController : Controller
{
...
[AllowAnonymous]
public AllUsersAction()
{
}
}
Except I actually do want to authorize AllUsersAction
, only all authorized users should be able to hit it, not just Admin.
What to do?
EDIT: I know that I can authorize the whole controller and provide more restrictions for all actions that should only be available to Admin
. But I'd rather not put attributes on every action but one.
The question could be better phrased: What would an implementation look like that would allow this 'minimalism' if it isn't currently possible?