declarative security on abstract classes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Hi Nick,

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

[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand,Infrastructure = true)] abstract class myclass { [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Infrastructure = true)] protected abstract void mymethod(); }"Nick" <[email protected]> wrote in messageIs 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?
 
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();

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top