Permit only the permissions in the set to be effective. Subsequent demand of any permission not in the set will fail, even if the permission was granted to the code. The duration of permit-only is until another permit-only in the same stack frame, or until return from the stack frame.
[Visual Basic] Overridable Public Sub PermitOnly() [C#] public virtual void PermitOnly(); [C++] public: virtual void PermitOnly(); [JScript] public function PermitOnly();
Use permit-only to temporarily limit code's granted permissions to those specified by the permission set.
PermissionSet Class | PermissionSet Members | System.Security Namespace