Search code examples
asp.netasp.net-mvcasp.net-roles

Additional layer to ASP.NET roles


Currently a User could be an administrator, a janitor, a teacher etc.. We currently are using the default providers.

Soon there should be multiple clubs. All the roles will be the same and available in all the clubs. Users could be in multiple clubs and have different roles in different clubs or they also could be in none.

The roles and clubs should be saved in a database.

Is there an easy way to do this. Ideally I would like to do something like this.

[Authorize Roles = RoleName.Foo + Clubname.Bar]

Solution

  • You can use Role Provider class to customize its behaviour and have it implemented your way like it shows here ASP.NET MVC - Alternative to Role Provider?

    At least to get you started and have some fresh ideas.

    Hope this helps.