You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/11/19 21:30:17 UTC

[airavata-django-portal] 03/03: Don't allow non admin users to create applications

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 20e04698adfe4c32b5c0cd08dd1c8ac3780fd945
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Mon Nov 19 15:56:03 2018 -0500

    Don't allow non admin users to create applications
---
 django_airavata/apps/admin/templates/admin/admin_base.html | 2 ++
 django_airavata/apps/admin/views.py                        | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/django_airavata/apps/admin/templates/admin/admin_base.html b/django_airavata/apps/admin/templates/admin/admin_base.html
index 6cf7e9d..9870592 100644
--- a/django_airavata/apps/admin/templates/admin/admin_base.html
+++ b/django_airavata/apps/admin/templates/admin/admin_base.html
@@ -9,9 +9,11 @@
  {% endblock %}
 {% block nav-items %}
 
+        {% if request.is_gateway_admin or request.is_read_only_gateway_admin %}
         <a href="{% url 'django_airavata_admin:app_catalog' %}" class="c-nav__item {% if request.active_nav_item == 'app_catalog' %}is-active{% endif %}" data-toggle=tooltip data-placement=right title="Application Catalog">
             <i class="fa fa-cogs"></i> <span class=sr-only>Application Catalog</span>
         </a>
+        {% endif %}
         <a href="{% url 'django_airavata_admin:credential_store' %}" class="c-nav__item {% if request.active_nav_item == 'credential_store' %}is-active{% endif %}" data-toggle=tooltip data-placement=right title="Credential Store">
             <i class="fa fa-lock"></i> <span class=sr-only>Credential Store</span>
         </a>
diff --git a/django_airavata/apps/admin/views.py b/django_airavata/apps/admin/views.py
index 68582d4..58c94d0 100644
--- a/django_airavata/apps/admin/views.py
+++ b/django_airavata/apps/admin/views.py
@@ -5,7 +5,10 @@ from django.urls import reverse
 
 @login_required
 def home(request):
-    return redirect(reverse('django_airavata_admin:app_catalog'))
+    if request.is_gateway_admin or request.is_read_only_gateway_admin:
+        return redirect(reverse('django_airavata_admin:app_catalog'))
+    else:
+        return redirect(reverse('django_airavata_admin:group_resource_profile'))
 
 
 @login_required