AnsweredAssumed Answered

show/hide Fields depending on role in a jsp

Question asked by kwantm on Sep 3, 2007
Latest reply on Sep 5, 2007 by kwantm

Iam looking for a way to show/hide fields depending on the role your have while you are logged in.

For example. I would like to make the field "encoding" readonly in the jsp /jsp/content/add-content-dialog.jsp hen you are NOT an administrator.

i have tried the tag  <r:permissionEvaluator value="ROLE_ADMINISTRATOR" allow="ROLE_ADMINISTRATOR">, but that does not seem to be working.

is there anyone that could point me in the right direction?

@Extra info:
My problem is two fold. first i need to know which files I should edit in order to alter the edit content option in de web-client. I think I have found all files that do this.

The second part is to prevent NON administrator of having access to the encoding property. Only administrators may edit this. I have tried the following (using a booleanEvaluator):

<a:booleanEvaluator value="#{NavigationBean.currentUser.isAdmin}">
                                       <h:outputText id="text12" value="#{msg.encoding}:" />
                                       <h:selectOneMenu id="encoding" value="#{AddContentDialog.encoding}">
                                          <f:selectItems value="#{AddContentDialog.encodings}" />

But it seems to have no effect..

Anybody any idears if Iam looking in the right direction in solving my problem????

kind regards,