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