473,508 Members | 2,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Emulating the [PrincipalPermissionAttribute ...] attribute

Hi,

I use the Enterprise Library, and the custom rule provider. A rule is check
with this piece of code:

public void HireEmployee (....) {
string rule = "Hire Employee";
// The next line fetch the rule definition in a config file, and checks
it with the role the object "myPrincipal" belongs to.
if (! this.ruleProvider.Authorize (this.myPrincipal, rule)) {
MessageBox.Show ("Youe are not authorise to hire en employee");
return;
}
... // plenty of interesting lines
}
__________________________________________________ __________________________
____
I would like to have this style of code:
[PrincipalRuleAttribute Name="Hire Employee"]
public void HireEmployee (....) {

... // plenty of interesting lines
}

In that case, if a call is made to "HireEmployee", a security exception is
thrown...

I know only the basics of the Attribute class, and I don't really see what
to do...

Oriane
Jul 21 '05 #1
0 971

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

Similar topics

0
1249
by: Kamilche | last post by:
""" Emulating Python inheritance manually. By loading it from disk at run time, you can create new custom types without programmer intervention, and reload them on demand, without breaking...
10
3702
by: Cezar | last post by:
Hello. How can simple emulating in IE this class ? ..example:hover{ border: 1px solid #696969; } Greets, Cezar.
2
2590
by: Bart | last post by:
Hi there, Since you've all told me that frames ar evil, I'm planning to disguard frames in favour of CSS "pseudo-frames" for my personal website. While trying to "emulate frames" (that is I...
5
2236
by: Stephan Schaem | last post by:
How does one write an unmanaged function that perform this functionality? In short I want to turn off/on visual style in my app... Thanks, Stephan PS: two people have been looking for...
0
799
by: Oriane | last post by:
Hi, I use the Enterprise Library, and the custom rule provider. A rule is check with this piece of code: public void HireEmployee (....) { string rule = "Hire Employee"; // The next line...
1
2083
by: jiffers | last post by:
I'm trying to figure out how to define an element in RNC so that its contents are validated if a definition matches, othewise no validation is done. The example given in the tutorial seems to...
4
3696
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
I am reposting this for a colleague because he has had some problems setting up his subscriber Nospam alias: I am having problems unit testing a method which is decorated with the attribute. I...
0
894
by: xamman | last post by:
hello! anyone ever manage to do this? after trying nearly everything i can think of my code (below) still gives 'request for principal permissions failed' . many thanks
3
1667
by: xamman | last post by:
hello! anyone ever manage to do this? after trying nearly everything i can think of my code (below) still gives 'request for principal permissions failed' . many thanks x .. .. ..
0
7331
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
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
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...
0
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.