470,815 Members | 1,340 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

declarative security on abstract classes

Is there a way to do declarative security on abstract classes? I am working
on a data access layer and would like to place all permission requirements on
the base class so all inherited classes contain the permissions. Is this
possible, and if so can anyone provide an example?
Jun 21 '06 #1
2 1193
Hi Nick,

Declarative security works the same with an abstract class as it does with
no class modifier.

[System.Security.Permissions.SecurityPermission(Sys tem.Security.Permissions.SecurityAction.Demand,Inf rastructure = true)] abstract class myclass { [System.Security.Permissions.SecurityPermission(Sys tem.Security.Permissions.SecurityAction.Demand, Infrastructure = true)] protected abstract void mymethod(); }"Nick" <nt********@online.nospam> wrote in messagenews:2B**********************************@m icrosoft.com...> Is there a way to do declarative security on abstract classes? I amworking> on a data access layer and would like to place all permission requirementson> the base class so all inherited classes contain the permissions. Is this> possible, and if so can anyone provide an example?

Jun 21 '06 #2
Hmm I don't know why my original response got all jumbled. I fixed the
example to watch for wrapping this time:

[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.Demand,
Infrastructure = true)]
abstract class myclass {

[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.Demand,
RemotingConfiguration = true)]
protected abstract void mymethod();

}
"Dave Sexton" <dave@jwa[remove.this]online.com> wrote in message
news:OA*************@TK2MSFTNGP03.phx.gbl...
Hi Nick,

Declarative security works the same with an abstract class as it does with
no class modifier.

[System.Security.Permissions.SecurityPermission(Sys tem.Security.Permissions.SecurityAction.Demand,Inf rastructure
= true)] abstract class myclass {
[System.Security.Permissions.SecurityPermission(Sys tem.Security.Permissions.SecurityAction.Demand,
Infrastructure = true)] protected abstract void mymethod(); }"Nick"
<nt********@online.nospam> wrote in
messagenews:2B**********************************@m icrosoft.com...> Is
there a way to do declarative security on abstract classes? I amworking>
on a data access layer and would like to place all permission
requirementson> the base class so all inherited classes contain the
permissions. Is this> possible, and if so can anyone provide an example?

Jun 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Daedalus.OS | last post: by
2 posts views Thread by Dave Veeneman | last post: by
18 posts views Thread by Bradley | last post: by
9 posts views Thread by Sean Kirkpatrick | last post: by
4 posts views Thread by N.RATNAKAR | last post: by
reply views Thread by emin.shopper | last post: by
6 posts views Thread by Miguel Guedes | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.