How to disable "Upload" on the top navigation for non admin users

14 views
Skip to first unread message

xnat pss

unread,
Jan 30, 2023, 4:28:11 PM1/30/23
to xnat_discussion
Hello XNAT team, 

Is it possible to hide the "Upload" menu item on the top navigation for non admin users.

Thanks
XP
xnat upload help.JPG
 

Rick Herrick

unread,
Jan 30, 2023, 4:49:58 PM1/30/23
to xnat_di...@googlegroups.com
Not directly, but you could add this fairly easily. The file that contains the upload menu is in the XNAT war (or exploded application) at xnat-templates/screens/topBar/Upload.vm. You could modify that so it looks like this:

<!-- Sequence: 30 —>
#if($turbineUtils.isSiteAdmin($user))
<li><a href="#upload">Upload</a>
    <ul>
        #addGlobalCustomScreens("topBar/Upload”)
    </ul>
</li>
#end

The only differences between this and the standard version of this file are the highlighted lines. You could put this directly in your deployment at templates/screens/topBar/Upload.vm (files under the templates folder take precedence over files with the same path but under xnat-templates) or you could build a simple plugin file by putting your template in a folder under META-INF/resources so that the full path to the file is:

META-INF/resources/templates/screens/topBar/Upload.vm

Then run:

jar cf upload-plugin.jar META-INF/resources/templates/screens/topBar/Upload.vm

Put upload-plugin.jar into your XNAT plugins folder and restart.

Rick Herrick
Senior Software Developer


------ Original Message ------
From "xnat pss" <xnat...@gmail.com>
To "xnat_discussion" <xnat_di...@googlegroups.com>
Date 1/30/2023 1:20:43 PM
Subject [XNAT Discussion] How to disable "Upload" on the top navigation for non admin users

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/670799ba-2269-4654-9bd7-c62c05637acfn%40googlegroups.com.

xnat pss

unread,
Feb 2, 2023, 9:51:11 PM2/2/23
to xnat_di...@googlegroups.com
That worked ! Many thanks

-XP

You received this message because you are subscribed to a topic in the Google Groups "xnat_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xnat_discussion/FhX-pDfEnFM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/em5ff92a37-30a2-472f-baef-2b052740d09b%40fbb96673.com.
Reply all
Reply to author
Forward
0 new messages