[Mono-list] Is PrincipalPermissionAttribute working?

Sébastien Pouliot spouliot@videotron.ca
Mon, 17 May 2004 11:35:24 -0400


Hello,

Yes you sample code should work without problem (if not then please fill a
bug).

An alternative would be to use Thread.CurrentPrincipal.IsInRole ("root") if
you do not want to deal with exceptions.

Sebastien Pouliot
http://pages.infinit.net/ctech/poupou.html


-----Original Message-----
From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com]On Behalf Of DI Mag. Rainer
Burgstaller
Sent: 17 mai 2004 10:55
To: spouliot@videotron.ca; mono-list@lists.ximian.com
Subject: Re: [Mono-list] Is PrincipalPermissionAttribute working?


Hello Sebastien

Thanks for the quick reply. So what would be the quickest alternative?

Would this work?

void MySecretFunction() {
	PrincipalPermission permission = new
PrincipalPermission(null,"root",true);
	permission.Demand();
	// do something secret here
}

> The PrincipalPermission class is implemented but Mono doesn't (and won't)
> support security attributes in 1.0.
> See bugzilla entry #52693 for more details.


cheers
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list