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
1
vote
0 answers
Updating Roles stopped working after publishing/deploying
I had a web app where I have used ASP.NET Identity, It was working fine on my machine but when I published it on the hosting server the Role system partially stopped working.
There was a portion of code where I used to manage Edit roles, here is the…

Ahmed Khaled
- 17
- 8
1
vote
1 answer
ASP.NET MVC Exception 'The Role Manager feature has not been enabled'
I'm trying to make an ASP.net MVC website. I have setup Roles in the Startup.cs file as follows:
private void CreateRolesAndUsers()
{
ApplicationDbContext context = new ApplicationDbContext();
var roleManager = new…

Wboston
- 11
- 3
1
vote
1 answer
How can i add a Identity Role in a ASP.NET Core Webapi
i would like add roles and use this roles in my ASP.NET Core Webapi. Can someone send me a exemple code? The Name of the Role is Admin.

einerixcode
- 35
- 6
1
vote
3 answers
Redirect on authorization failure
I have several sections

Alexander
- 11
- 2
1
vote
1 answer
Assigning a role to an existing user
Good day everyone,
I am having some trouble assigning a role to an existing user in MVC5, which will be done by an Admin from a view only accessible by an Admin Thus far I have created a role upon startup and assigned it to a SuperUser who will…

Leeven Persad
- 15
- 5
1
vote
1 answer
where i use addDynamicPermissionsPolicy in ASp.net Core2
I implemented policy in Asp.net. for dynamic role. I do not know where write function with name 'AddDynamicPermissionsPolicy'. please help me.

Samira Rahimi
- 9
- 1
1
vote
1 answer
Displaying content dynamically based on user role
My page hides content if the user isn't in a role that should see it.
Currently I have 2 roles that can see this content: global and admin.
If the user is in either of these roles, they should be able to see the content, but I'm having trouble…

Ortund
- 8,095
- 18
- 71
- 139
1
vote
0 answers
Cannot add IdentityRole - InvalidRoleName
I am trying to Create an Identity Role in ASP .NET Core. When I try to create a role, I am getting this error message and the value is not getting inserted.
Output:
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting…

FireDrakon
- 275
- 2
- 6
- 19
1
vote
0 answers
Error in getting role of looged in user MVC C#
I am trying to get the role of currently logged in user. Here is my code
string[] rolesuserbelongto = Roles.GetRolesForUser();
in web.config
The error I am getting is the following
An error occurred during the…

Philomath
- 1,145
- 4
- 18
- 28
1
vote
2 answers
Add custom column in AspNetRoles results in Invalid Column Name Discriminator
I'm using ASP.NET MVC5 with Identity 2 framework, Database first
I'm trying to custom AspNetRoles, by adding a column called MyCustomColumn
However, my app crashes because :
Invalid Column Name Discriminator
There is a lot of resources on SO and…

AlexB
- 7,302
- 12
- 56
- 74
1
vote
1 answer
Assign a user to AspNetUserRole in Console Line Application C#
I have a program where I read a CSV file of email addresses and user data, and bring it into a C# console line application, and write each one into the AspNetUser table (assuming it passes validation).
I can write in a new user via the following…

Mike Upjohn
- 1,251
- 2
- 16
- 38
1
vote
2 answers
error while trying to seed data for user and role in Asp.Net mvc 5 EntityFramework 6
While I try to update the database with the seed data for user and role I get a "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details." error. The roles get created, I can see them in the db table, but…

Arianit
- 543
- 2
- 8
- 24
1
vote
1 answer
How to create Role and User in ASP.Net identity?
I used following method to create two roles and two users when my web app starts (In Application_Start() in Global.asax.cs).
However the Administrator role is being created but not the User role. Similar thing happens for user named Admin@admin.com…

Parvez M Robin
- 154
- 1
- 3
- 16
1
vote
1 answer
How do I perform 2 different ActionResults in the same controller within the same view?
I am trying to remove a role from my application user on ActionLink click and when it is successful send a Viewbag message. The issue I am having currently is that when I try to remove the user from the role, the page is being refreshed. The reason…

Skullomania
- 2,225
- 2
- 29
- 65
1
vote
1 answer
Authenticate based off LDAP Group in Webconfig
The setup is as follows:
I have an AD Security Group "DOMAIN\MYGROUP" populated with users.
I have an LDAP eDir Group "DOMAIN\MYGROUP-Approvers" populated with admins for the group.
In my webconfig I can use the AD Security Group to authenticate and…

kmc5117
- 67
- 3
- 10