ASP.NET role management helps you to manage authorization, allowing you to specify which resources various users in your application are allowed to access. Role management lets you group users by assigning them to roles.
Questions tagged [asp.net-roles]
226 questions
2
votes
1 answer
User IsInRole only works after signing in and out from the website
I am adding and removing users from roles in my controller code and in my shared _Layout view, I am using User.IsInRole to check and remove links accordingly but it only works if user signs out of the website then User.IsInRole returns correct…

Learn AspNet
- 1,192
- 3
- 34
- 74
2
votes
2 answers
Asp.net MVC Let user switch between roles
I'm developing a complex website with users having multiple roles. The users are also coupled on other items in the DB which, together with their roles, will define what they can see and do on the website.
Now, some users have more than 1 role, but…

Stefanvds
- 5,868
- 5
- 48
- 72
2
votes
1 answer
How to configure role based access permissions in C# and ASP.NET using Identity framework?
What I have tried so far:
I placed a Web.config in a folder I want to protect with the following content which should grant access to admin, second_level and third_level users only.
…

Stephan Ahlf
- 3,310
- 5
- 39
- 68
2
votes
1 answer
What is the common way to maintain accessibility in ASP.NET MVC?
I'm developing a pure web api backend using ASP.NET MVC to support my android application, I'm just wondering that which way to maintain accessibility of user would you like to recommend me?
In my application, there is a sign in/ sign up…

OOD Waterball
- 707
- 1
- 11
- 31
2
votes
1 answer
ASP.NET Identity Role already exits
I am building a Multi-tenant application. For this reason I have added a column named OwnerId (Owner of the Role). I have been having some trouble adding a Role to AspNetRoles table using ASP.NET Identity.
I have a custom RoleValidator that…

chrisdyck
- 27
- 1
- 8
2
votes
1 answer
IsUserInRole issue with Domain Admins group (not a configuration issue)
I am seriously beginning to think that where I work is cursed as far as development efforts go, I keep running into very strange issues.
I am using Roles.IsUserInRole(@"Domain\Domain Admins") to check if a user is a Domain Administrator.
For some…

Keith Clark
- 609
- 1
- 7
- 19
2
votes
1 answer
how to add role with same name and some customize column using asp.net identity?
IdentityResult result = _roleManager.Create(new Role("TestRole", 6, "Test Role Description"));
db.Roles.Add(new Role() {
Id = Guid.NewGuid().ToString(),
Name = "TestRole", companyId = 6,
description =…

Chirag Solanki
- 21
- 1
2
votes
3 answers
VB conversion to C#
I've used a converter to change vb to c# and one of the lines originally is:
Dim roles = System.Web.Security.Roles.GetAllRoles()
Dim roleNames() As String = roles.Where(Function(x) x.ToLower() <> "Admin").ToArray()
When the conversion returns I…

T.J.
- 31
- 5
2
votes
2 answers
Custom roles in ASP.NET
I am working on an ASP.NET website which uses forms authentication with a custom authentication mechanism (which sets e.Authenticated programmatically on protected void Login_Authenticate(object sender, AuthenticateEventArgs e)).
I have an ASP.NET…

Arseni Mourzenko
- 50,338
- 35
- 112
- 199
2
votes
1 answer
Calling UserManager.AddToRole erases user password?
I am fairly new to MVC5/ASP.NET Identity and I have found an issue that has stumped me a bit.
I am writing a small form for my ASP.NET MVC5 application that will allow an admin user (member of the Admins role) to review the users that have signed up…

Brad Sprigg
- 23
- 2
2
votes
1 answer
Adding ASP.NET MVC5 Identity Roles to my existing intranet project
I've read a lot of blog posts concerning the Identity way to handle Role Management in MVC5 but most of them seem to integrate registration systems and the such. I want to know if I can simply use the Roles.
I have an existing MVC5 project where I…

Orphu.of.io
- 125
- 1
- 16
2
votes
1 answer
RoleProvider injection with Ninject
First off I want to say there is a ton of answers on SO and google searches surrounding this, however I'm running into an issue that prevents those solutions from working. The answer here seems to be the way to go.…

The Muffin Man
- 19,585
- 30
- 119
- 191
2
votes
1 answer
Individual page authorization based on roles in ASP.NET MVC 5
I am pretty new to ASP.NET MVC, and I'm trying to build a web-site that uses MVC 5's built-in authorization methods.
Here's what I've done so far:
Created a number of users in the AspNetUsers table.
Created a number of roles in the AspNetRoles…

Scopperloit
- 920
- 12
- 23
2
votes
1 answer
What is the best way to manage ASP.NET Identity roles and membership
Now that Microsoft has removed support for the ASP.NET Web Application Management tool in Visual Studio 2013, what is the best way to manage users and roles in your ASP.NET applications?
I'm starting on a new web app, and instead of building my own…

Justin Adkins
- 1,214
- 2
- 23
- 41
2
votes
2 answers
How to set nested roles in asp.net Membership
I want to set some of the permission for the particular depending of Role of current user.
For example:
I have to role 3 roles
let it be
Super Admin
Admin
Supervisor
If I set permission for supervisor, super admin and admin should automatically…

Arjun Sharma
- 595
- 2
- 9
- 23