Authorization: What Are You Allowed to Do?
Depending on who you are, a system grants you more or fewer privileges to access certain areas.
Think about the highly secured headquarters of a national security agency in an action movie, for
example. Even if the main character is allowed to enter the building, he is often not allowed to enter
specific areas because he lacks the proper authorization (the fact that the hero eventually gains
access in those movies using a two-minute hack in the system is beside the point here).
To determine what a user is allowed to do, a system needs to know two things: the permissions for
the current user and the authorization rules for the resource a user is trying to access.
The permissions for the user are based on her username (the identity it represents) and the roles (or
security groups) the user is optionally assigned to. Similarly, resources can be opened up or blocked
for specific users or roles. When there is a match between the current user and the access rules for
the resource a user is trying to access, the user is granted access. If the user is blocked specifically,
access is denied. Imagine a file that is only accessible to the user Tom and the group Developers. The
user Tom can access that file, regardless of whether he is in the Developers role. At the same time,
the user Charlotte must be in the Developers role in order to access the file.
You see how to work with these concepts in the remainder of this chapter.
A large part of these security concepts in ASP.NET are implemented with the so-called application
services, discussed next.
Authorization: What Are You Allowed to Do?Depending on who you are, a system grants you more or fewer privileges to access certain areas.Think about the highly secured headquarters of a national security agency in an action movie, forexample. Even if the main character is allowed to enter the building, he is often not allowed to enterspecific areas because he lacks the proper authorization (the fact that the hero eventually gainsaccess in those movies using a two-minute hack in the system is beside the point here).To determine what a user is allowed to do, a system needs to know two things: the permissions forthe current user and the authorization rules for the resource a user is trying to access.The permissions for the user are based on her username (the identity it represents) and the roles (orsecurity groups) the user is optionally assigned to. Similarly, resources can be opened up or blockedfor specific users or roles. When there is a match between the current user and the access rules forthe resource a user is trying to access, the user is granted access. If the user is blocked specifically,access is denied. Imagine a file that is only accessible to the user Tom and the group Developers. Theuser Tom can access that file, regardless of whether he is in the Developers role. At the same time,the user Charlotte must be in the Developers role in order to access the file.You see how to work with these concepts in the remainder of this chapter.A large part of these security concepts in ASP.NET are implemented with the so-called applicationservices, discussed next.
การแปล กรุณารอสักครู่..
