Custom CodeAccessSecurityAttribute
From: Martin Lapierre (lapierrem_at_cedrom-sni.com)
Date: 10/29/03
- Next message: artj \(removethis\) _at_yahoo.com: "security access to cdrom/cdrw"
- Previous message: Pieter Philippaerts: "Re: Another RSACryptoServiceProvider question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 29 Oct 2003 17:46:44 -0500
I try to make a custom CodeAccessSecurityAttribute, but hit the wall at
every corner.
I created a simple custom security attribute, which is working (see below).
But...
1) I have to put the assembly in "C:\Program Files\Microsoft Visual Studio
.NET 2003\Common7\IDE": shoudn't it be the application's directory instead?
2) I'm unable to debug it.
Any clues as how to change the required directory and how to debug the
assembly?
(The goal is, in the end, to access a database in the attribute.)
Thanks!
Martin
==== Code ====
[AttributeUsage(AttributeTargets.Method)]
public class CustomPermissionAttribute : CodeAccessSecurityAttribute
{
public CustomPermissionAttribute(SecurityAction action)
: base(action)
{}
public override IPermission CreatePermission()
{ return new PrincipalPermission("john", "role"); }
}
- Next message: artj \(removethis\) _at_yahoo.com: "security access to cdrom/cdrw"
- Previous message: Pieter Philippaerts: "Re: Another RSACryptoServiceProvider question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|