简体   繁体   中英

Asp.net membership permissions and roles

I am new to the ASP.NET membership interface.

I understand how the User and Roles work with each other, but i cant seem to understand how to connect between the roles and the permissions.

The Membership and the Roles auto creates tables in my db, but I don't see any reference to the permissions aspect.

Any ideas?

ASP.NET Membership works on the aspect that your application will provide checks for the roles that a user currently belongs to and handle the processing of permissions from there.

Simply put, in your application code, you will have to insert something similar to handle verifying a user has permission to a function:

if (Roles.IsUserInRole("RoleName")) {
    // Do something here
}

This essentially creates the premise of permissions, when a user is assigned a Role, they then can perform actions based on what the system allows them to in which the role(s) they belong to grants them the ability to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM