disable browse for public

9 views
Skip to first unread message

genomics

unread,
Oct 4, 2019, 3:13:22 PM10/4/19
to SEEK Developers
We have set up a site using the SEEK platform. To browse programmes, projects and data files, users don't have to register. Is there any way to limit the browse activity only to register users? In other words, we would like users register and login to view any information. The Browse menu should be disable without login. How can we accomplish this?

Thanks!
JZ

Stuart Owen

unread,
Oct 18, 2019, 10:13:03 AM10/18/19
to genomics, SEEK Developers
Hi,
Sorry,  I hadn't seen this question until just now.

So Programmes and Projects are always public and browseable. This is fixed, and because the intention is to promote and disseminate details about your project.
Data files, and other "assets" however, have sharing permissions and can be made private. You can set the default sharing permissions for your project, and items uploaded will adopt those permissions by default when associated with the project. 

If you want to block access to the projects and programmes for anonymous users you would need to change the code. A simple way could be to add a before_action near the top of the projects_controller.rb, and programmes_controller.rb, which would look like:

before_action :login_required


you could also hide the browse menu by wrapping with some code that checks 'logged_in_and_registered?' or 'logged_in_and_member?' - the latter checks the user is a member of a project. For example: https://github.com/seek4science/seek/blob/417f87c7599bac87b41b224b258a219dba2fb4f0/app/views/assays/_buttons.html.erb#L3

I've not tested the above, and may have some side effects I've not concidered, but would be a good starting point.

hopefully this helps,

Stuart Owen



--
You received this message because you are subscribed to the Google Groups "SEEK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seek-develope...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/seek-developers/8991b490-8275-49dd-9b27-2d332b32f14b%40googlegroups.com.

jingz...@gmail.com

unread,
Oct 18, 2019, 3:45:33 PM10/18/19
to SEEK Developers
Thanks. This is very helpful.
To unsubscribe from this group and stop receiving emails from it, send an email to seek-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages