Questions tagged [roleprovider]

Built-in and custom implementations of ASP.NET's Role Provider, as part of Membership functionality in the System.Web.Security namespace.

ASP.NET supports user authentication and authorization through a provider-based model. In support of the authorization providers, there is a Role Provider which supports filtered access to resources by checks against pre-assigned roles.

MSDN Documentation

Managing Authorization Using Roles

Understanding Role Management

Role Management Providers

ASP.NET Security

Questions for this Tag

Questions that should have this tag pertain to use of the default ASP.NET Role Providers (AspNetSqlRoleProvider & AspNetWindowsTokenRoleProvider), as well as questions about extending/overriding the built-in provider.

386 questions
0
votes
1 answer

Sharing a SQLExpress database between EF and SqlRoleProvider

I have a database in SQLExpress 2008 that I am accessing via an EF4 connection. It also contains the ASP.Net role provider tables for the website. In the web.config there are two separate connection strings pointing to the same database. When it…
Colin Desmond
  • 4,824
  • 4
  • 46
  • 67
0
votes
0 answers

Why does role management not work on my ASP.NET site?

I have a web application in ASP.NET, which has a site map. One of these menu items must be displayed only, if the user is assigned role roleX.
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
0
votes
0 answers

GetRolesForUser returns null

In the background of my mvc 4 application i am running a scheduler that does some tasks. When i want to get the roles from a specific user the functions returns a nullreference exception. An unhandled exception of type…
Jamie
  • 3,031
  • 5
  • 36
  • 59
0
votes
1 answer

Custom ASP.NET MVC Role Provider not working

I have a simple role provider I created. LocalBankRoleProvider: public override bool IsUserInRole(string username, string roleName) { var user = _repository.GetUser(username); var role = _repository.GetRole(roleName); if…
0
votes
1 answer

set controllers using custom role provider in mvc 4

I am new to custom role providers and roles. I need to show some functionalities in the home page. If Admin enters the page it will show some button like delete, alter. If Normal user login the home page it will show some features like view and…
dinesh.k
  • 197
  • 1
  • 8
  • 24
0
votes
1 answer

Unity dependency injection in an ASP MVC 5.0 RoleProvider defined in configuration

I'm trying to implement a role provider using a separate EF repository class, as an injectable dependency, to access my roles store. My problem is that the role provider is defined in configuration (web.config) and therefore is not instantiated via…
Will
  • 1,080
  • 12
  • 13
0
votes
1 answer

Get full name of users from GetUsersInRole

I'm using SQL Role Provider and to get a list of users within the 'Admin' Role, I'm using the below code: string[] list = Roles.GetUsersInRole("Admin"); This gives me a list of AD username. How do I get the users full name (i.e. First Name + Last…
viv_acious
  • 2,429
  • 9
  • 34
  • 55
0
votes
4 answers

How to hide a link depending on the user's role in ASP.NET MVC?

I am trying to find out how to hide a link depending on the users role. So when the user logs in and is sent to the home page, I want the following link (to view users) hidden from view if the user is not an admin:
  • @Html.ActionLink("Users",…
  • Shawn
    • 2,355
    • 14
    • 48
    • 98
    0
    votes
    2 answers

    ASP.net Authorization issue

    I have an application that uses Active Directory to authenticate users to login to my website. I also have a table in my database with user Types. Based on the User Type, my users can see different VIEWS. Ex: NormalUser can see 3 views (About -…
    fazlook1
    • 139
    • 2
    • 15
    0
    votes
    1 answer

    Simple Membership and Role Provider in MVC3/MVC4

    I'm writting Simple Membership and Role Provider. I'm trying run the code from post http://www.brianlegg.com/post/2011/05/09/Implementing-your-own-RoleProvider-and-MembershipProvider-in-MVC-3.aspx but on run IIS show me error: Configuration…
    0
    votes
    1 answer

    ASP.NET web forms - how to combine WIF authentification with membership provider and role provider

    I'm using windows identity foundation with form authentification in ASP.NET Web Forms in .NET 4.5 How can I combine WIF form authentification with my custom membership provider and my custom role provider defined in web.config? I want to use my…
    Cyrus
    • 2,261
    • 2
    • 22
    • 37
    0
    votes
    1 answer

    PrincipalContext is not getting the latest user roles from active direcory

    I have a custom role provider for an ASP.NET MVC site which is retrieving the roles for a user using a PrincipalContext as below. This works fine, except there is a long delay between changing groups in Active Directory and it appearing in the…
    0
    votes
    1 answer

    Custom Membership and Roles in MVC3 with Forms Authentication

    I use custom membership for Users and Roles in my MVC3 application. I have custom user/roles class. And I have the extended the RoleProvider and MembershipProvider classes for this. I seem to have a case of roles going missing sometimes in my…
    SimpleUser
    • 1,341
    • 2
    • 16
    • 36
    0
    votes
    1 answer

    C# MVC Do i have to use DB for Role Provider

    I've been trying to use role provider but its been giving me headaches for a week. All I am trying to do is allow a user to be able to see "Admin" Page if they are an admin (I've added Admin Coloumn in my database, to be 0 or 1) Here is the code in…
    kayze
    • 738
    • 8
    • 19
    • 33
    0
    votes
    2 answers

    How to make RavenDB DocumentStore available to calling APIs

    I have an MVC4 application using RavenDB as a datastore. The application has MVC/Web, Domain, Data, and Security layers. I am writing custom membership and role providers that need to initialize the database and access the DocumentStore. I'm writing…