
Only is ignored for a permission not granted because a demand for that permission will not succeed. B will cause a stack walk to terminate if methods further down the call stack demand any permissions other than a File. Here, we have to specify what permissions will not determine a negative outcome (or continue stack walk unaffected). Only specifies the only permissions that do not cause the stack walk to fail.
It is different from Deny - Deny specifies permissions that will cause the stack walk to fail, but Permit. It is similar to Deny in the sense both cause stack walks to fail when they would otherwise succeed. Trust may have additional custom permissions, if defined. Trust and Everthing or identical permission sets. Intranet, Internet, Everything By Default, Full. So if X = Intranet, then Assembly A will be granted the Permission set of Everything.
Suppose an assembly A has the following evidence set: Zone = X, Hash = Y, Strong Name = Z. Group Example: Suppose a Code Group B has the membership condition: Zone=Intranet and Permission Set = Everything. When an assembly evidence contains an evidence entry matching the code group membership condition, that assembly is a member of the code group, and thus permission set assigned to the code group is granted to the assembly Example classes: Union. It is an association between a membership condition and a permission set. Code Groups: Building blocks of security policies. Membership condition: A specific value of an evidence type e.
Permission Set: named set of permissions registered in a specific security policy. App domain and isolated storage: This is based on the identity of the assembly and the app domain in which the assembly is loaded. App domains and role-based security: By default, the app domain through which a thread runs, defines the principal on whose behalf the thread acts. App domains and security policy-while the enterprise level, machine level, and user level security policy levels are fixed, app domain security policy may be defined programmatically.
Application domain evidence and identity-when an application domain is created, it can be assigned some evidence CLR grants permissions to an app domain based on the evidence an action by an assembly is controlled both by assembly permission set and app domain permission set. Assembly evidence and identity-when an assembly is loaded into an app domain, we can specify additional evidence to apply to the assembly-evidence determines the permissions granted by CLR to the assembly.
More on Application Domains and Security