cancel
Showing results for 
Search instead for 
Did you mean: 

display information only to admin user

alpha
Champ in-the-making
Champ in-the-making
hi guys,

i am trying to customize browse.jsp to display specific information only to admin user. I want hide content-panel to user other than admin, and in the space panel i would like to hide columns modified and actions to all users other than admin.

For the first point, i've managed to do such when using tag <a:booleanEvaluator> as follows

<a:booleanEvaluator value="#{NavigationBean.currentUser.admin == true}" id="evalAcontent">
        <%– Details - Content –%>
         ……
</a:booleanEvaluator>
and it works fine

But for the second, it doesn't work well with <a:booleanEvaluator>, here is the code :
<%– Modified Date column for details/icons view modes –%>
<a:booleanEvaluator value="#{NavigationBean.currentUser.admin == true}" id="evalMod">
<a:column id="col7" style="text-align:left">
<f:facet name="header">
<a:sortLink id="col7-sort" label="#{msg.modified}" value="modified" styleClass="header"/>
</f:facet>
<h:outputText id="col7-txt" value="#{r.modified}">
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
</h:outputText>
</a:column>

<%– Space Actions column –%>
<a:column id="col9" actions="true" style="text-align:left">
<f:facet name="header">
<h:outputText id="col9-txt" value="#{msg.actions}"/>
</f:facet>

<r:actions id="col9-acts1" value="space_browse" context="#{r}" showLink="false" styleClass="inlineAction" />
<a:menu id="spaces-more-menu" itemSpacing="4" image="/images/icons/more.gif" tooltip="#{msg.more_actions}" menuStyleClass="moreActionsMenu">
<r:actions id="col9-acts2" value="space_browse_menu" context="#{r}" />
</a:menu>
</a:column>
</a:booleanEvaluator>
if i connect with a non-admin user it works (information are not displayed) but when i connect as admin no information is displayed !!!

how can i do to make this work correctly?
I have also tried to used rendered attribute for tag <a:column>, as follows:
<a:column id="col7" style="text-align:left" rendered="#{NavigationBean.currentUser.admin == true}">
do you recommend this?
Any help is appreciated.
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
Instead of wrapping the booleanevaluator around several columns, remove it and try add this attribute to each column you want to hide for non-admin users:

rendered="#{NavigationBean.currentUser.admin == true}"
Thanks,

Kevin

alpha
Champ in-the-making
Champ in-the-making
thanks for ur reply

actually i have tried this, and it's not working, it doesn't make any diffrence whether i put this code or not. The column is displayed to all users.

<a:column id="col7" style="text-align:left" rendered="#{NavigationBean.currentUser.admin == true}">
<f:facet name="header">
<a:sortLink id="col7-sort" label="#{msg.modified}" value="modified" styleClass="header"/>
</f:facet>
<h:outputText id="col7-txt" value="#{r.modified}">
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
</h:outputText>
</a:column>

Have u managed to make it work?
thanks for helping