Disabling Project and Subject Creation.

29 views
Skip to first unread message

Sanket Gupte

unread,
Apr 26, 2013, 6:06:31 PM4/26/13
to xnat_di...@googlegroups.com
Hi,

Is there a way I could disallow everyone except the admin (and may be a couple of other users), to create new projects or subjects.
Well, creating more projects is actually fine, but it is really important for me to disallow creation of new subjects. I am importing subject data from an external database. (and sharing those subjects into projects) And I don't want to allow people to 'create' a new subject if it already doesn't exist. Or creating duplicate subjects.

Thanks a lot
Sanket

Miklos Espak

unread,
Apr 27, 2013, 3:37:11 AM4/27/13
to xnat_di...@googlegroups.com
Hi Sanket,

I have a little tweak that hides the "New Project" menu item from the
ordinary users.

Create a module and copy the original "screens/topBar/New/Default.vm"
template to "src/main/templates/screens/topBar/New/Default.vm" in your
module.

Replace this line:

<li><a href="$link.setPage("XDATScreen_add_xnat_projectData.vm")">$displayManager.getSingularDisplayNameForProject()</a></li>

by this:

#if($data.getSession().getAttribute("user").checkRole("Administrator"))
<li><a href="$link.setPage("XDATScreen_add_xnat_projectData.vm")">$displayManager.getSingularDisplayNameForProject()</a></li>
#end


The same could be done for the "New Subject" a few lines below.

Note that this does does not prevent people from creating projects or
subject through the REST API.

You should also remove the "Add / Subject" action from the right side
action box somehow, but I do know know where is it controlled.

Regards,
Miklos
Reply all
Reply to author
Forward
0 new messages