Questions tagged [asp.net-roles]

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.

226 questions
1
vote
1 answer

Sharepoint like AD authentication restricting access to specific web pages

I have a couple of PHP applications that run over WAMP Server, and for management reasons my boss told me to migrate the into an IIS server and ASP.NET so we only have to manage one database of users, in this case the Active Directory Users Group…
1
vote
1 answer

How to create dynamic roles and authorizations on MVC3

I use C#-MVC3 (for web). I want to create a list of operations to do in the site (for example - open a new article, comment on an article, etc.) and the site's administrator will create roles (administrator, articles-administrator, editor, guest,…
TamarG
  • 3,522
  • 12
  • 44
  • 74
0
votes
1 answer

ASP.NET MVC 3: manage users and roles inside the internet application

When I now want to manage (create/delete/edit) Users and Roles for my MVC 3 internet application, I need to go to inetmgr on the server and change the .NET Roles / .NET Users there. Is it possible to manage these users and roles from within the MVC…
juFo
  • 17,849
  • 10
  • 105
  • 142
0
votes
1 answer

ASP.Net Membership: List Roles in Listbox

I'm trying to put together a custom user update page so you can update a user's email, password and role all on one page. I'm stuck on the roles. I have listed the roles ok, but I want to select the role allocated to the user in a listbox. In this…
ComfortablyNumb
  • 1,448
  • 10
  • 37
  • 64
0
votes
1 answer

adding user to a role when registering

I am using the built-in register module in asp.net application for registering new users. I am trying to set the role for the user when they are registering but for some reason I can't access the textbox control in the backend code to add the new…
Laziale
  • 7,965
  • 46
  • 146
  • 262
0
votes
1 answer

Redirecting based on the user's role

i'm having some problem over here..when user enter their id and password,it will show up the main page and its for user but when admin or staff enter their id,it will enter the user's main page and i have to click admin site on the top hyperlink…
0
votes
2 answers

Redirecting admin to admin page and user to user's page

i'm having some problem over here. When user enter their id,it will show up the main page and its for user but when admin enter their id,it will enter the user's main page and i have to click admin site on the top hyperlink and it automatically…
0
votes
0 answers

Policy based authorization vs. custom Authorize attribute

We have 60-70 claims at the moment for different thing that users can do throughout the API endpoints. That number will grow as we grow our API. We want to decorate each endpoint with the required claim. Now, we have 2 options: Create custom…
dee zg
  • 13,793
  • 10
  • 42
  • 82
0
votes
1 answer

Redirect user based on roles (without running OnGet)

Users for my ASP.NET Core application have different roles. And different roles have access to different pages. I've implemented policies and correctly authorized various folders for the related roles. But I also need to redirect some users to a…
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
0
votes
1 answer

ASP.Net core 7, IsInRoleAsync returns false

I try to have admin user generated in the database when the starts. I add a user and a role to the db using the IdentityDbContext. here is the context: public class UserContext : IdentityDbContext { public…
0
votes
0 answers

C# & ASP.NET MVC roles - rolling back deleted roles when passing through context and not commiting

This is the simplified partial pseudo code from the calling method: using (var context = new ModelContext()) { var transaction = context.Database.BeginTransaction(); try { // Delete stuff here …
NicCodes
  • 9
  • 2
0
votes
0 answers

ASP.NET Core Authorize & UserRoles in Multy Tenancy

We have am ASP.NET Core 6.0 multi tenant application with a single database. The tenant tables have a TenantId column to show only tenant data. We don't need to discuss whether is better or not to have multiple databases, for our purpose we need it…
John Mathison
  • 904
  • 1
  • 11
  • 36
0
votes
1 answer

No parameterless constructor defined for this object in MVC 5 while creating identity roles

I am developing ASP.NET MVC 5 application for which i need Role-based authorization. While creating the new role i encounter error "No parameterless constructor defined for this object". Even tough i have defined the constructer. Here is my…
Zahid
  • 36
  • 6
0
votes
0 answers

How to fix Invalid OperationException: Multiple constructors accepting all given argument types have been found in type 'System.Collections.Generic

I have seen variations to this question asked. But none of the answers seem to help me. When trying to view a list of roles in my view after hitting the AddOrRemoveUsers button(see picture) I get the following error message. I cant find where the…
0
votes
1 answer

asp.net MVC EF 6 Identity only allowed to select 'lower' roles

I have these roles setup within identity and one role is assigned per user 00 - Super Admin 10 - Admin 20 - Staff Manager 30 - Staff 40 - User Manager 50 - User The aim is to allow a user to change the role of other users below (not equal to) their…
Sparki
  • 161
  • 1
  • 7