This page last changed on Feb 08, 2006 by mark@atlassian.com.
Sometimes it is useful to remove certain elements from JIRA's user interface if the user does not belong to a certain group. Most of the time this can be achieved by editing certain JSP / Velocity files. The JSP files are easy to edit as they are text files, and one does not need access to JIRA's source code.
For JIRA 3.5+
In velocity, you can hide certain elements from the UI by surrounding the relevant code with:
#if ($authcontext.user.inGroup('jira-administrators'))
...
#end
So to hide the security level you need to edit the file WEB-INF\classes\templates\jira\issue\field\comment-edit.vm and end up with something like this.
#if ($authcontext.user.inGroup('jira-administrators'))
#if ($commentLevels && !$commentLevels.isEmpty())
#controlHeader ($action 'commentLevel' $i18n.getText('comment.viewable') false $displayParameters.get('noHeader'))
...
#controlFooter ($action '' $displayParameters.get('noHeader'))
#end
#end
You need to update both places in the file and then restart JIRA.
For versions prior to 3.5
To hide certain elements from the UI one has to surround the relevant code with:
<webwork:if test="/remoteUser/inGroup('jira-administrators') == true">
...
</webwork:if>
If you would like to allow only members of the jira-administrators group to be able to set a level for a comment (restrict comment's visibility), just surround the code that creates the ' Viewable By:' drop down box.
So that the code looks something like:
<webwork:if test="/remoteUser/inGroup('jira-administrators') == true">
<webwork:if test="commentLevels/size > 0">
<ui:select label="text('comment.add.viewableby.label')" name="'commentLevel'" list="commentLevels"
listKey="'.'" listValue="'.'">
<ui:param name="'headerrow'" value="text('comment.constants.allusers')" />
<ui:param name="'headervalue'" value="''" />
</ui:select>
</webwork:if>
</webwork:if>
You will need to do this in the following files that are located under the JIRA web application:
- secure/views/issue/addcomment.jsp
- includes/panels/updateissue_comment.jsp
- secure/views/issue/viewissue.jsp
 | If you make changes such as this, you will need to remember to port them to a new version of JIRA when you upgrade |
|