You can pass the roles without using [Authorize (Roles="Role name")]

3

My system has dynamic roles ("groups"), the user that adds and places users in.

Also arrow that if it can Insert, edit, delete, etc ...

With the use of Asp.net Identity Roles, can you do this dynamically, without using "Role=", that is, without passing it fixedly in the controller?

Is there any way? or I'll have to do this part of roles from scratch the way I need ...

    
asked by anonymous 22.08.2014 / 15:27

1 answer

1

Basically, the idea would be to write your own authorization attribute. It can be done on ASP.NET Identity or ASP.NET Membership.

There is an answer in which I talk about more alternative forms of authorization , such as the implementation of permissions by activities. Basically, reimplementing permissions using ASP.NET Identity gives more work because there are several methods within the interface that need to be written. On the other hand, the possibilities are greater. The Membership, although it is simpler, is a little more limited.

In this answer I teach to implement a simple authorization attribute for ASP.NET Membership.

    
22.08.2014 / 17:13