A system regulates access to resources requested by an operation executing on
a
computer. The operation invokes a plurality of methods that operate upon code during
execution. The system includes a policy file, a call stack, and an execution unit.
The policy file stores permissions for each of the resources. The permissions authorize
particular types of access to the resource based on a source of the code and an
executor of the code. The call stack stores representations of the methods and
executors in an order of invocation by the operation. The execution unit grants
access to the resource when the types of access authorized by the permissions of
all of the methods and executors on the call stack encompass the access requested
by the operation.