BUG: The CodeAccessPermission.Deny method does not always work as expected (317869)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
This article was previously published under Q317869 SYMPTOMS When you use the CodeAccessPermission.Deny method to deny permission to a resource, the method does not
always work as expected. A user can work around CodeAccessPermission.Deny to obtain access to the resource, even after the method is
called. RESOLUTION Do not use CodeAccessPermission.Deny to deny access to a resource. Use the CodeAccessPermission.PermitOnly method. This method allows only the specified permissions and
successfully denies everything else, as in the following sample code: [C#]
[RegistryPermissionAttribute(SecurityAction.PermitOnly, Read="HKEY_XXX")]
This sample code grants Read permissions to the registry key only. No
other access is allowed. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
REFERENCES To review to the "Deny" topic in the Help documentation,
refer to the following Microsoft Developer Network (MSDN) article:
Modification Type: | Minor | Last Reviewed: | 1/25/2006 |
---|
Keywords: | kbvs2005doesnotapply kbvs2005swept kbtshoot kbvs2002sp1sweep kbbug kbdocerr kbpending KB317869 kbAudDeveloper |
---|
|