I’m creating a website where an Admin can add Teachers and Students, the admin should be able to specify what the Teacher can do when he’s in a particular Location.
Is it possible to extend the Authorize attribute to check in what Location the specific user is in? for example [Authorize(Roles = “Administrator”, Location=”ICT”)] ?
And if so, how can I extend this?
Thanks in advance.
By writing a custom authorize attribute:
and then: