asp.net-roles Questions

5

I can get all users like this var users = UserManager.Users.ToList(); I can find a role like this var role = db.Roles.SingleOrDefault(m => m.Name == "User"); I want to list all users with ...
Laurelaureano asked 29/3, 2016 at 9:24

5

Solved

I want to have list of all the users registered on my site with their roles. Id | Name | Role 1 | ABC | Admin 2 | DEF | User Something like this, I have made Roles controller in which all t...
Schramm asked 3/1, 2015 at 20:1

5

Solved

I am trying to get a list of all the roles in my application. I have looked at the following post Getting All Users... and other sources. Here is my code which I think is what I am supposed to do. ...
Guelph asked 23/11, 2014 at 14:53

2

Solved

What is the difference between using policy-based authorization and authorize with role, or there is no difference? [Authorize(Policy = "RequiredAdminRole")] and [Authorize(Roles = &quot...
Scandian asked 19/10, 2019 at 15:2

7

I know the new Membership includes a "Simple Role Provider." I can't find any help related to creating a user and assigning a role when the user is created. I've added a user which created the ta...
Paraformaldehyde asked 30/10, 2013 at 16:58

3

Solved

First of all, I'm aware of this question: MVC 5 AddToRole requires logout before it works? and this one: What is ASP.NET Identity's IUserSecurityStampStore<TUser> interface? so please d...
Instrumentalism asked 21/4, 2016 at 10:1

3

Solved

I'm in a bit of a bind with implementing Roles in ASP.NET MVC 5. I am attempting to log in as a user that does not have a role required to access the area of the application I'm trying to reach. Wh...

4

Solved

Before the update of the dll's in the Entity Framework i was able to do this user.Roles.Where(r => r.Role.Name == "Admin").FisrtOrDefault(); Now, i can only do r.RoleId, and i can't find a w...
Casting asked 5/6, 2015 at 15:54

1

Solved

I'm currently trying to implement security in a new ASP MVC 5 application, based on user roles. The goal is to prevent users from accessing certain controllers or controller methods if they don't h...
Airdrie asked 13/12, 2016 at 13:3

2

Solved

I've created controller classes to assist with Role authorization. I have a base class ControllersAuthorities, which is the highest level of authority. I have created the other classes to extend e...

2

Solved

In MVC4 i used Roles.IsUserInRole to check if a given user is in some role. However, with MVC5 i can't do it anymore... At first, it asked me to enable RoleManager at the web.config but then i dis...
Conventionalism asked 9/9, 2014 at 10:26

1

Solved

In my previous post i asked how to check/add user roles, but now i face another problem. Since microsoft moved to the new Identity 2.0, AuthorizeAttribute doesn't work anymore. Is there any substi...

5

Solved

I have a controller which is protected by the [Authorize] attribute. This works very good (I am sent back to login if I am not logged in), but I wish to add some roles to this attribute, I've rea...
Recife asked 8/1, 2014 at 17:9

1

When you create an MVC Application with Windows Authentication, it adds roles and what not to your database tables... How do you add those in manually if you have created the project as an empty pr...

1

Solved

I created a new MVC application in the new VS2013 IDE. I added the following to the Login Action on the AccountController as I wanted to create a default user dynamically: var admin = new Applicat...
Megilp asked 23/10, 2013 at 13:36

4

Solved

ASP.NET MVC allows users the ability to assign permissions to functionality (i.e. Actions) at Design Time like so. [Authorize(Roles = "Administrator,ContentEditor")] public ActionResult Foo() { r...

1

Solved

Im new to asp.mvc. I'm trying to develop a portal to maintain employee data. In my system only "Manager" has the rigths to create employee. How do I enable the link when manager log in and disable ...
Manzoni asked 18/6, 2012 at 7:19

2

Solved

I'm working on an Asp.Net 4.0 web application which is using the Membership and Roles features of Asp.Net. In the application, there will be three roles which have access to the login page and one...
Embrasure asked 18/5, 2012 at 15:29

2

I am developing an ASP.NET website in Visual Studio 2010 (with Service Pack 1, thank you very much). I want to utilize .NET's built-in Membership and Role providers for SQL Server 2008. Now, I've ...
Brusquerie asked 26/4, 2011 at 1:27

2

Solved

I have basic Single Sign-On working across 2 MVC sites (call them SiteA and SiteB) using something along the lines of the following method: http://forums.asp.net/p/1023838/2614630.aspx They are o...
Unweighed asked 30/8, 2010 at 1:18

3

Solved

There are plenty of questions (and information) on setting up asp.net membership, role providers and the like. Whether or not you should use the built in platform provided by microsoft, or role ext...
1

© 2022 - 2024 — McMap. All rights reserved.