473,406 Members | 2,620 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.

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 968

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

Similar topics

0
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
by: Cezar | last post by:
Hello. How can simple emulating in IE this class ? ..example:hover{ border: 1px solid #696969; } Greets, Cezar.
2
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.