I use ASP.NET and to do access control by level, I use a filter that checks the user's permission level and allows access to view .
[HttpPost]
[AutorizacaoFilterAttribute] //Esse filtro analisa a permissão do usuário
public ActionResult GetEmailAnalisysData()
{
}
But inside the Filter, I need to make a switch
for every view I add [AutorizacaoFilterAttribute]
and this ends up being tiresome, outside that I'll forget about add on one or the other.
The question is: Is it possible to pass parameters through filter ? example:
[HttpPost]
[AutorizacaoFilterAttribute(1)] //1 significa o nível necessário para esse filter, assim eu me livro de precisar fazer um switch comparando o nome de cada view
public ActionResult GetEmailAnalisysData()
{
}