473,241 Members | 1,607 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,241 software developers and data experts.

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 1286
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
2
by: Dave Veeneman | last post by:
Is is legal to declare abstract members in non-abstract classes? How about non-abstract members in abstract classes? I am writing a base class with three derived classes. The base class will...
18
by: Bradley | last post by:
I'm trying to determine if there's a general rule for when an Interface should used vs. an Abstract Class. Is there any design advantage to using one or the other? Brad
9
by: Sean Kirkpatrick | last post by:
To my eye, there doesn't seem to be a whole lot of difference between the two of them from a functional point of view. Can someone give me a good explanation of why one vs the other? Sean
8
by: Manuel | last post by:
Hi! If I've a vector filled with abstract classes, can I push in it the derived classes too? Even if derived classes have new methods? I've done some experiments, and it seem I can push the...
4
by: N.RATNAKAR | last post by:
hai, what is abstract class and abstract method
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
6
by: Miguel Guedes | last post by:
Hello, I recently read an interview with Bjarne Stroustrup in which he says that pure abstract classes should *not* contain any data. However, I have found that at times situations are when it...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am actually a VB.Net guy, but I have worked somewhat with C++ and C#. I just want to ask about the relationship between Abstract Classes and Interfaces. My first question is if...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.