pwpwpw Posted December 23, 2009 Share Posted December 23, 2009 Hi, I'm trying to remove some icons in the repository explorer by modifying repositoryExplorer.jsp. For example, i want to remove Schedule Reports icon and Run in Background icon by using the <authz:authorization> tag to only allow ROLE_ADMINISTRATOR to use those features. This works, but it breaks the javascript(repositoryExplorer.js) that sets the other icons to either _enabled.gif or _disabled.gif, so everything else down the line ends up with enabled.gif by default. So it seems I would also have to modify repositoryExplorer.js Is there a proper way of setting security around those icons? Thanks,pw Link to comment Share on other sites More sharing options...
mdjj Posted December 24, 2009 Share Posted December 24, 2009 We disabled certain icons for certain roles within this jsp. The key is to ensure that the display style is set to none for users who shouldn't see the icon otherwise you'll get javascript errors. Shouldn't need to mess with the js file.i.e. to display the open in Designer button for a certain role(s)<authz:authorize ifAnyGranted="SOME_ROLE"> <td style="cursor: pointer;" width='50' height='50' onClick='' id='design_td' align="center"> <a href='#' class='normalpx' id='design_td_a'><img src="images/design_enabled.gif" border='0' title='<spring:message code="RM_BUTTON_DESIGN" javaScriptEscape="true"/>' id='design' /></a> </td></authz:authorize> Then for users who don't have the role you need to set display:none<authz:authorize ifNotGranted="SOME_ROLE"> <td style="cursor: pointer; display: none;" width='50' height='50' onClick='' id='design_td' align="center"> <a href='#' class='normalpx' id='design_td_a'><img src="images/design_enabled.gif" border='0' title='<spring:message code="RM_BUTTON_DESIGN" javaScriptEscape="true"/>' id='design' /></a> </td></authz:authorize>I think this is correct, it's been a while since I made this change so may not be quite right.Hope this helps. Link to comment Share on other sites More sharing options...
pwpwpw Posted December 24, 2009 Author Share Posted December 24, 2009 Perfect. It works.Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now