c# - Is a Role Provider implementation necessary? -
I'm struggling to fully understand that the right to apply window authentication and role-based authentication schemes What's the MVC4 application when the user reaches the user (intranet) website, then I can currently check the following method in the username against a database table
list & lt; String & gt; PermissionList = PermissionBo.GetUserPermissionsList (permission B.ParseUserName (User.Identity.Name)); Permissions Permissions = New Permissions (Permission List); Then if the state adds a role to a user object:
if (permissions.IsAdmin) {if Roles.RoleExists ("UtilitiesToolAdmin ")) {Rolls. Creteol ("UtilitiesToolman"); } If the roles are (i.eu.er. Inroll (user.indenti.name, "utility tool")) (roles.Audersrorroll (new string) {user.indenti.name}, "utilities tooladmin");}} I think there can be a wrong way to go about implementing this, but I'm not sure where I am wrong. To do this, start using the certified feature Is sufficient for:
[Pvt If not, what am I missing?
If you are investigating the simple role, then a custom role provider may be a bit overwhelmed (the role provider manages the roles themselves Do you also provide facilities to do) will you end up with a class filled
new ImplementedException () Throw; Instead, consider creating a custom user principal. The ipronele interface defines an insolve method that gives a boost. This is where you will examine your custom role. The advantage of custom user principal is that everyone now built in ASP.NET Roll-Checking Goodies should "just work", as long as you change the default user principal object with a custom one in the lifecycle sufficiently.
Comments
Post a Comment