I would like to use the mysql role provider for aspnet. I have setup a custom table for the users using the attribute userTableName="user". Now the problem is that when I assign users to roles, MYSQLRolesprovider creates an entry in a table "my_aspnet_usersinroles" which and "my_aspnet_users". I would like to specify that the table used to specify roles should be the "user" table. How do I do that? Do I need to write a custom role provider? Is there a setting that I can tweak to make that association? Or am I just using this whole system wrong? Thanks
ASP MySQLRoleProvider tie roles to users
147 Views Asked by Sello Mkantjwa At
2
There are 2 best solutions below
1
Mark Fitzpatrick
On
You need separate tables for users and their roles. Generally, it's three in total, one for the users, one for the roles, and one to tie a user with one or more roles. The usersinroles table allows the one to many relationship so your user can have more than one role. Also, good database design would dictate this as well as the user table should only contain artifacts directly related to the user itself.
Related Questions in MYSQL
- MySQL Select Rank
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Push mysql database script to server using git
- Why does mysql stop using indexes when date ranges are added to the query?
- Google Maps API Re-size
- store numpy array in mysql
- Whats wrong with this query? Using ands
- MySQL-Auto increment
- show duplicate values subquery mysql
- Java Web Application Query Is Not Working
- microsoft odbc driver manager data source name not found and no default driver specified
- Setting foreign key in phpMyAdmin
- No responses from google places text search api
- Adding to MAMP database in SQL/PHP
- I want to remove certain parent- and child-divs in all my wordpress posts with php or some other script
Related Questions in ASP.NET
- Create an IIS web request activity light
- Writing/Overwriting to specific XML file from ASP.NET code behind
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- Getting deeply embedded XML element values
- What is best way to check if any of the property of object is null or empty?
- NuGet - Given a type name or a DLL, how can I find the NuGet package?
- ASP-MVC Code-first migrations checkbox not active
- How do i add onclient click to my jquery button
- Jquery: Change contents of <select> tag dynamically
- Retrieving data from Oracle database
- ASP.NET: Fill Textbox field upon dropdownlist selection by user
- Why web API return 404 when deploy to IIS
Related Questions in SQLMEMBERSHIPPROVIDER
- Use ASP.Net Membership Provider in MVC (instead of SimpleMembership)
- SQL GetProfileElement - migrating sqlmembership provider to identity 2.0
- Delete SQL Membership from Website
- Allow space in SqlMembershipProvider password
- SqlMembershipProvider With Aspnet_regsql.exe And Web.Config Configurations
- I have added a user and assigned him to a role, when i use Membership.GetAllUsers() it returns none
- ClientCredential usage
- How can I create a user for ASP.Net/Umbraco SQL Membership from iPhone and WCF?
- Adding existing users from a table to a membership database
- Using ASP.Net SqlMembershipProvider with multiple databases
- create FK to model, from aspnet forms validation tables
- ASP.NET SQL Server Registration Tool Not Finding Any Databases
- Using an existing SqlMembershipProvider database with an ASP.NET MVC app
- custom membership provider asp.net
- Correct usage of SqlMembershipProvider Profiles
Related Questions in SQLROLEPROVIDER
- SqlRoleProvider.GetRolesForUser confusion: 'Object reference not set to an instance of an object'
- Add new Role to SiteMap
- Advanced .NET Membership/Role Provider
- SqlRoleProvider on IIS8 Express
- SqlRoleProvider: NullReferenceException when calling Roles.GetRolesForUser
- What do the ASP.NET Universal Providers enable that the default sql providers don't?
- ASP.NET 3.5 IIS7 Roles Security Implementation
- ProviderException: InvalidCastException
- How to assign users the security roles associated with Active Directory
- Does Role Provider cache per request?
- Roles.CreateRole insert fails
- How can I manage stored procedure rights of the role in SQL Server
- Database role can access the table through stored procedure for which it has no access
- ASP MySQLRoleProvider tie roles to users
- ASP.Net MVC 4 Manage Roles - Windows Authentication
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If you want Membership Provider to use your User table, you need to implement Custom Membership Provider.
Custom Membership Provider requires a lot of work especially if you are new to Membership Provider and Provider Model.
Alternative Approach
OR