473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Custom CodeAccessSecurityAttribute

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"); }
}
Nov 15 '05 #1
8 4996
Martin -
the right thing to do is to put the assembly containing attribute
implementation in the GAC and add it to the fully trusted assemblies list
(caspol -af).
Hope this helps.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no rights.
"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:Op**************@TK2MSFTNGP12.phx.gbl...
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"); }
}

Nov 15 '05 #2
Thanks, but do you know how I can debug such an assembly ?

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
Martin -
the right thing to do is to put the assembly containing attribute
implementation in the GAC and add it to the fully trusted assemblies list
(caspol -af).
Hope this helps.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no rights.

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:Op**************@TK2MSFTNGP12.phx.gbl...
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"); }
}


Nov 15 '05 #3
Martin -
what debugging problems are you having? Do you have the rigth debug symbols
at the right place? Are you using VS or cordbg?
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no rights.
"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
Thanks, but do you know how I can debug such an assembly ?

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
Martin -
the right thing to do is to put the assembly containing attribute
implementation in the GAC and add it to the fully trusted assemblies list
(caspol -af).
Hope this helps.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no

rights.


"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:Op**************@TK2MSFTNGP12.phx.gbl...
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"); }
}



Nov 15 '05 #4
I use VS and the attribute is in the GAC (I can see that its code is
executed). But I can't step-in the code of the attribute assembly. It's kind
of called by the framework somewhere. I need to be able to debug the
attribute assembly to add more sophisticated code. Do you know how to debug
that assembly?

Thanks again for any help!

PS: Right now, I'm testing with a pretty basic attribute:

[AttributeUsage(AttributeTargets.Method)]
public class CustomPermissionAttribute : CodeAccessSecurityAttribute
{
public CustomPermissionAttribute(SecurityAction action)
: base(action)
{
}

public override IPermission CreatePermission()
{
return new PrincipalPermission("User");
}
}

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OZ****************@TK2MSFTNGP12.phx.gbl...
Martin -
what debugging problems are you having? Do you have the rigth debug symbols at the right place? Are you using VS or cordbg?
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no rights.

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
Thanks, but do you know how I can debug such an assembly ?

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
Martin -
the right thing to do is to put the assembly containing attribute
implementation in the GAC and add it to the fully trusted assemblies list (caspol -af).
Hope this helps.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no

rights.


"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:Op**************@TK2MSFTNGP12.phx.gbl...
> 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"); }
> }
>
>



Nov 15 '05 #5
Martin -
you won't be able to step-in because there is no explicit call into the
attribute code. Try setting a breakpoint and then starting the process being
debugger. In the 'Modules' window make sure the debug symbols are loaded for
the module containing the attribute implementation.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This posting is provided "AS IS" with no warranties, and confers no rights

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:O2****************@TK2MSFTNGP09.phx.gbl...
I use VS and the attribute is in the GAC (I can see that its code is
executed). But I can't step-in the code of the attribute assembly. It's kind of called by the framework somewhere. I need to be able to debug the
attribute assembly to add more sophisticated code. Do you know how to debug that assembly?

Thanks again for any help!

PS: Right now, I'm testing with a pretty basic attribute:

[AttributeUsage(AttributeTargets.Method)]
public class CustomPermissionAttribute : CodeAccessSecurityAttribute
{
public CustomPermissionAttribute(SecurityAction action)
: base(action)
{
}

public override IPermission CreatePermission()
{
return new PrincipalPermission("User");
}
}

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OZ****************@TK2MSFTNGP12.phx.gbl...
Martin -
what debugging problems are you having? Do you have the rigth debug

symbols
at the right place? Are you using VS or cordbg?
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no

rights.


"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
Thanks, but do you know how I can debug such an assembly ?

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
> Martin -
> the right thing to do is to put the assembly containing attribute
> implementation in the GAC and add it to the fully trusted assemblies

list
> (caspol -af).
> Hope this helps.
> --Ivan
> http://blogs.gotdotnet.com/ivanmed
> This message is provided "AS IS" with no warranties, and confers no
rights.
>
>
> "Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
> news:Op**************@TK2MSFTNGP12.phx.gbl...
> > 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"); }
> > }
> >
> >
>
>



Nov 15 '05 #6
Ivan, we're getting closer, but it's not working: I've made sure to load the
module; I've even added a static method to the attribute that I call before
using the attribute (I can step into that method). BUT I can't step in the
instance method (breakpoints can be set but don't work). The feeling I have
is that for security, the assembly containing the attribute is loaded by the
framework in some other process (???).

I also tried asserting the method to find my way in, but noting came up.

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Martin -
you won't be able to step-in because there is no explicit call into the
attribute code. Try setting a breakpoint and then starting the process being debugger. In the 'Modules' window make sure the debug symbols are loaded for the module containing the attribute implementation.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This posting is provided "AS IS" with no warranties, and confers no rights

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:O2****************@TK2MSFTNGP09.phx.gbl...
I use VS and the attribute is in the GAC (I can see that its code is
executed). But I can't step-in the code of the attribute assembly. It's

kind
of called by the framework somewhere. I need to be able to debug the
attribute assembly to add more sophisticated code. Do you know how to

debug
that assembly?

Thanks again for any help!

PS: Right now, I'm testing with a pretty basic attribute:

[AttributeUsage(AttributeTargets.Method)]
public class CustomPermissionAttribute : CodeAccessSecurityAttribute
{
public CustomPermissionAttribute(SecurityAction action)
: base(action)
{
}

public override IPermission CreatePermission()
{
return new PrincipalPermission("User");
}
}

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OZ****************@TK2MSFTNGP12.phx.gbl...
Martin -
what debugging problems are you having? Do you have the rigth debug

symbols
at the right place? Are you using VS or cordbg?
--Ivan
http://blogs.gotdotnet.com/ivanmed
This message is provided "AS IS" with no warranties, and confers no

rights.


"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
> Thanks, but do you know how I can debug such an assembly ?
>
> "Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
> news:OX**************@TK2MSFTNGP10.phx.gbl...
> > Martin -
> > the right thing to do is to put the assembly containing attribute
> > implementation in the GAC and add it to the fully trusted assemblies list
> > (caspol -af).
> > Hope this helps.
> > --Ivan
> > http://blogs.gotdotnet.com/ivanmed
> > This message is provided "AS IS" with no warranties, and confers no > rights.
> >
> >
> > "Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
> > news:Op**************@TK2MSFTNGP12.phx.gbl...
> > > 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"); }
> > > }
> > >
> > >
> >
> >
>
>



Nov 15 '05 #7
Well, that will probably be my last comment on this. I've added a file trace
in the attribute. The funny thing is that the trace is written to the file
when the assembly that uses the attribute is COMPILED. My conclusion is that
the *code access security* attribute is tested between the assemblies at
compile time and not at runtime, and that all the appropriate security info
is set in the using assembly's metadata. I guess that if I want to debug the
attribute dll, I have to use the compiler as the executing process. Far too
much trouble for what I need. Weird issue.

Martin

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
Ivan, we're getting closer, but it's not working: I've made sure to load the module; I've even added a static method to the attribute that I call before using the attribute (I can step into that method). BUT I can't step in the
instance method (breakpoints can be set but don't work). The feeling I have is that for security, the assembly containing the attribute is loaded by the framework in some other process (???).

I also tried asserting the method to find my way in, but noting came up.

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Martin -
you won't be able to step-in because there is no explicit call into the
attribute code. Try setting a breakpoint and then starting the process

being
debugger. In the 'Modules' window make sure the debug symbols are loaded

for
the module containing the attribute implementation.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This posting is provided "AS IS" with no warranties, and confers no rights

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:O2****************@TK2MSFTNGP09.phx.gbl...
I use VS and the attribute is in the GAC (I can see that its code is
executed). But I can't step-in the code of the attribute assembly. It's
kind
of called by the framework somewhere. I need to be able to debug the
attribute assembly to add more sophisticated code. Do you know how to

debug
that assembly?

Thanks again for any help!

PS: Right now, I'm testing with a pretty basic attribute:

[AttributeUsage(AttributeTargets.Method)]
public class CustomPermissionAttribute : CodeAccessSecurityAttribute
{
public CustomPermissionAttribute(SecurityAction action)
: base(action)
{
}

public override IPermission CreatePermission()
{
return new PrincipalPermission("User");
}
}

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:OZ****************@TK2MSFTNGP12.phx.gbl...
> Martin -
> what debugging problems are you having? Do you have the rigth debug
symbols
> at the right place? Are you using VS or cordbg?
> --Ivan
> http://blogs.gotdotnet.com/ivanmed
> This message is provided "AS IS" with no warranties, and confers no
rights.
>
>
> "Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
> news:eF**************@TK2MSFTNGP12.phx.gbl...
> > Thanks, but do you know how I can debug such an assembly ?
> >
> > "Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in
message > > news:OX**************@TK2MSFTNGP10.phx.gbl...
> > > Martin -
> > > the right thing to do is to put the assembly containing attribute > > > implementation in the GAC and add it to the fully trusted

assemblies > list
> > > (caspol -af).
> > > Hope this helps.
> > > --Ivan
> > > http://blogs.gotdotnet.com/ivanmed
> > > This message is provided "AS IS" with no warranties, and confers no > > rights.
> > >
> > >
> > > "Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
> > > news:Op**************@TK2MSFTNGP12.phx.gbl...
> > > > 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"); }
> > > > }
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #8
Martin -
what you are observing is expected. The declarative security attributes are
stored in the assembly metadata in the xml format, which gets created at the
compile time, so the contructor and the ToXml-related code is being invoked
at the compile time. At the run time the attribute is being read,
de-serialized and the right permission object is created.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This posting is provided "AS IS" with no warranties, and confers no rights
"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
Well, that will probably be my last comment on this. I've added a file trace in the attribute. The funny thing is that the trace is written to the file
when the assembly that uses the attribute is COMPILED. My conclusion is that the *code access security* attribute is tested between the assemblies at
compile time and not at runtime, and that all the appropriate security info is set in the using assembly's metadata. I guess that if I want to debug the attribute dll, I have to use the compiler as the executing process. Far too much trouble for what I need. Weird issue.

Martin

"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
Ivan, we're getting closer, but it's not working: I've made sure to load

the
module; I've even added a static method to the attribute that I call

before
using the attribute (I can step into that method). BUT I can't step in the
instance method (breakpoints can be set but don't work). The feeling I

have
is that for security, the assembly containing the attribute is loaded by

the
framework in some other process (???).

I also tried asserting the method to find my way in, but noting came up.

"Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Martin -
you won't be able to step-in because there is no explicit call into the attribute code. Try setting a breakpoint and then starting the process

being
debugger. In the 'Modules' window make sure the debug symbols are loaded
for
the module containing the attribute implementation.
--Ivan
http://blogs.gotdotnet.com/ivanmed
This posting is provided "AS IS" with no warranties, and confers no rights
"Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
news:O2****************@TK2MSFTNGP09.phx.gbl...
> I use VS and the attribute is in the GAC (I can see that its code is
> executed). But I can't step-in the code of the attribute assembly. It's kind
> of called by the framework somewhere. I need to be able to debug the
> attribute assembly to add more sophisticated code. Do you know how
to debug
> that assembly?
>
> Thanks again for any help!
>
> PS: Right now, I'm testing with a pretty basic attribute:
>
> [AttributeUsage(AttributeTargets.Method)]
> public class CustomPermissionAttribute : CodeAccessSecurityAttribute > {
> public CustomPermissionAttribute(SecurityAction action)
> : base(action)
> {
> }
>
> public override IPermission CreatePermission()
> {
> return new PrincipalPermission("User");
> }
> }
>
> "Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in message
> news:OZ****************@TK2MSFTNGP12.phx.gbl...
> > Martin -
> > what debugging problems are you having? Do you have the rigth debug > symbols
> > at the right place? Are you using VS or cordbg?
> > --Ivan
> > http://blogs.gotdotnet.com/ivanmed
> > This message is provided "AS IS" with no warranties, and confers no > rights.
> >
> >
> > "Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
> > news:eF**************@TK2MSFTNGP12.phx.gbl...
> > > Thanks, but do you know how I can debug such an assembly ?
> > >
> > > "Ivan Medvedev [MS]" <iv*****@online.microsoft.com> wrote in

message > > > news:OX**************@TK2MSFTNGP10.phx.gbl...
> > > > Martin -
> > > > the right thing to do is to put the assembly containing attribute > > > > implementation in the GAC and add it to the fully trusted

assemblies
> > list
> > > > (caspol -af).
> > > > Hope this helps.
> > > > --Ivan
> > > > http://blogs.gotdotnet.com/ivanmed
> > > > This message is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > >
> > > >
> > > > "Martin Lapierre" <la*******@cedrom-sni.com> wrote in message
> > > > news:Op**************@TK2MSFTNGP12.phx.gbl...
> > > > > 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"); }
> > > > > }
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nick | last post by:
My client uses a SQL Database to store their usernames and passwords, and I do not believe they have AD...no big deal... I wrote a class to create a generic identity and generic principal so that...
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
0
by: Willem van Rumpt | last post by:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <OOtt3CadGHA.3632@TK2MSFTNGP05.phx.gbl> Newsgroups: microsoft.public.dotnet.languages.csharp...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.