Thursday, 8 August 2013

Kendo UI Security Trimming TabStrip

Kendo UI Security Trimming TabStrip

I have implemented custom security aspects into a ASP.NET MVC project. I
am also using Kendo UI. I have read in Kendo UI documentation that Kendo
UI provides security trimming features. Explicitly stated is that for a
TabStrip control if the OnAuthorization operation set a
HttpUnauthorizedResult then the corresponding tab that initiated the
action request will not be shown.
So I have implemented a class derived from AuthorizeAttribute and have
overridden OnAuthorization to perform custom authorization. When
authorization has been identified as failing I set a
HttpUnauthorizedResult in the supplied AuthorizationContext result field.
What I'm getting is the app stays on the login page. I'm expecting the app
to start but the view that contains the tab I was testing should be
hidden.
What I'd like to know is how to setup the AuthorizeAttribute
OnAuthorization method to prepare the result so that the Kendo UI behaves
as described. The documentation on Kendo UI does not detail this out.
Peter

No comments:

Post a Comment