Re: Rescue not working for PrincipalPermission thrown security exception

2 views
Skip to first unread message

Adam Belshaw

unread,
Jul 22, 2009, 5:10:15 AM7/22/09
to castle-pro...@googlegroups.com
My fault, apologies,

The PrincipalPermission attribute was kicking in before my AuthorizationFilter so the Thread.CurrentPrincipal hadn't been set yet. I honestly thought I'd checked that.

Cheers anyway,

Adam.

2009/7/22 Adam Belshaw <adam.b...@internetware.co.uk>
Hello,

I'm trying to show a security specific exception as mentioned in the faq http://www.castleproject.org/monorail/faq.html

And above my controller I have

[Rescue("securityerror", typeof(SecurityException))]
[PrincipalPermission(SecurityAction.Demand, Role = "Basic")]

But it isn't kicking in? The rescues are working for other exceptions, just not ones thrown from the PrincipalPermission attribute. Not even the general error rescue is kicking in. Has anyone had this before and knows a solution? Am I doing something wrong? I've tried various combinations of ordering the attributes and putting them on base classes, methods etc.

Thanks,

Adam.



--
Adam Belshaw
Internetware Limited

Connect your Website with your Sage accounting software. Visit www.getconnect.co.uk for more information

T: 0845 123 2920
F: 0845 123 2921
E: adamb...@internetware.co.uk
W: www.internetware.co.uk

Internetware Limited, i6, 6-8 Charlotte Square, Newcastle, NE1 4XF.
Company No. 04433554. VAT Registration No. 796 5763 59

This message is intended for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Adam Belshaw

unread,
Jul 22, 2009, 4:46:41 AM7/22/09
to castle-pro...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages