JAVA Fine-grained Access Control-4
Access Control: The java.security.AccessController class implements a dynamic stack inspection algorithm. The method checkPermission() provides permission grant check. Example: FilePermission p = new FilePermission("/tmp/junk", "read");
AccessController.checkPermission(p);
Privilege: Privileges are used to grant temporary permission to less-trusted code. Whenever a resource access is attempted, all code traversed by the execution thread up to that point must have permission for that resource access, unless some code on the thread has been marked as "privileged". That is, suppose access control checking occurs in a thread of execution that has a chain of multiple callers. When the AccessController checkPermission method is invoked by the most recent caller, it decides whether to allow or deny the requested access.