RE: Quering PrincipalPermissionAttributes on class

From: Pasi Häkkinen (pasi.hakkinen_at_newsgroup.nospam)
Date: 05/26/05


Date: Wed, 25 May 2005 22:46:12 -0700

Hello and thanks for your answer,

I sure meant "PrincipalPermissionAttribute", my mistake.. Our site is highly
customized by user roles, even for different signed-in users, and we want to
keep it as simple as possible for all the users. This is why we don't want to
confuse them with unnessary links that will end up on an error page. We do
have security exception handling function on these pages in case the user
will get through to such a page.

Surely we can check the security requirements separately for each hyperlink
using for example Page.User.IsInRole(...), but this adds the risk of coding
errors by possibly leading to unsyncronized security (link showing even
though no rights to see the page). It would be safe to check against
PrincipalPermissionAttribute and links would never go out of sync. Does this
make sense? Any other thoughts?

Regards,
Pasi

"[MSFT]" wrote:

> Hello,
>
> Did you mean "PrincipalPermissionAttribute"? All Attribute only work a
> class instance was raise. We cannot detect the security exception without
> create such a class.
>
> I suggest you may consider some staff about exception handling about this
> issue. For example, if a security exception was thrown, you can redirect to
> a web form to let user know he doesn't has enough permission.
>
> Luke
>
>