Author Topic: using spring security authorization in param query grid.  (Read 2738 times)

bsolteam

  • Pro Deluxe
  • Full Member
  • *
  • Posts: 107
    • View Profile
using spring security authorization in param query grid.
« on: September 17, 2014, 06:50:01 pm »
Hi ,

I am working with Spring and param query and facing one issue.
My issue is

I am using one param query grid and in that grid in title i have 3 buttons.
I am implementing spring security for authorization and want to hide one button based on the role of the user who has logged in.

spring security code is working fine for normal HTML components but i am getting error while using it with param query title.

My code for buttons
title:    "<a href='#' id='publish'><img border='0' src='${pageContext.request.contextPath}/resources/images/publish.png' style='width: 70px;height: 19px;margin:-4px;'></a>&nbsp;&nbsp&nbsp&nbsp&nbsp<a href='gotohome' id='cancel'><img border='0' src='${pageContext.request.contextPath}/resources/images/cancel.png' style='width: 60px;height: 19px;margin:-4px;'></a>&nbsp;&nbsp&nbsp&nbsp&nbsp<a href='#' id='rollback'><img border='0' src='${pageContext.request.contextPath}/resources/images/rollback.png' style='width: 80px;height: 19px;margin:-4px;'></a>",


here i want to implement spring security authorization and changed the code like

   title:    "<sec:authorize access="hasRole('ROLE_PP_PUBLISH')"><a href='#' id='publish'><img border='0' src='${pageContext.request.contextPath}/resources/images/publish.png' style='width: 70px;height: 19px;margin:-4px;'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</sec:authorize><a href='gotohome' id='cancel'><img border='0' src='${pageContext.request.contextPath}/resources/images/cancel.png' style='width: 60px;height: 19px;margin:-4px;'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<sec:authorize access="hasRole('ROLE_RBPP_PUBLISH')"><a href='#' id='rollback'><img border='0' src='${pageContext.request.contextPath}/resources/images/rollback.png' style='width: 80px;height: 19px;margin:-4px;'></a></sec:authorize>",

Please let me know how i can achieve this.

Thanks