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 2023/02/21 23:44:40 UTC

[airavata-django-portal] branch develop updated (a5d6cd17 -> ac13f848)

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

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


    from a5d6cd17 AIRAVATA-3682 Fix token based auth
     new 496530cc AIRAVATA-3682 Users may have write access on shared directory but can never delete it
     new ac13f848 AIRAVATA-3682 Upgrading sdk version to get write permission metadata

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 django_airavata/apps/api/serializers.py                            | 7 ++-----
 .../js/components/storage/UserStoragePathViewer.vue                | 6 +++++-
 requirements.txt                                                   | 2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)


[airavata-django-portal] 02/02: AIRAVATA-3682 Upgrading sdk version to get write permission metadata

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ac13f84896f0d204d164be0b65a9b95fb4d1e9e4
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Feb 21 18:44:27 2023 -0500

    AIRAVATA-3682 Upgrading sdk version to get write permission metadata
---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index 5908b842..ea048a44 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -24,7 +24,7 @@ grpcio-tools==1.51.1 ; python_version >= "3.7"
 grpcio==1.48.2 ; python_version < "3.7"
 grpcio==1.51.1 ; python_version >= "3.7"
 
-airavata-django-portal-sdk==1.8.1
+airavata-django-portal-sdk==1.8.2
 airavata-python-sdk==1.0.2
 airavata-django-portal-commons==1.0.0
 


[airavata-django-portal] 01/02: AIRAVATA-3682 Users may have write access on shared directory but can never delete it

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 496530cca4370d97bf5fdbe834dce0d18076bf07
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Feb 21 18:43:41 2023 -0500

    AIRAVATA-3682 Users may have write access on shared directory but can never delete it
---
 django_airavata/apps/api/serializers.py                            | 7 ++-----
 .../js/components/storage/UserStoragePathViewer.vue                | 6 +++++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/django_airavata/apps/api/serializers.py b/django_airavata/apps/api/serializers.py
index 618075f2..f2339ea5 100644
--- a/django_airavata/apps/api/serializers.py
+++ b/django_airavata/apps/api/serializers.py
@@ -575,7 +575,7 @@ class DataProductSerializer(
 
     def get_userHasWriteAccess(self, data_product: DataProductModel):
         request = self.context['request']
-        file_metadata = user_storage.get_data_product_metadata(request, data_product_uri=data_product.productUri)
+        file_metadata = user_storage.get_data_product_metadata(request, data_product=data_product)
         if "userHasWriteAccess" in file_metadata:
             return file_metadata["userHasWriteAccess"]
         else:
@@ -979,11 +979,8 @@ class UserHasWriteAccessToPathSerializer(serializers.Serializer):
             else:
                 return False
 
-        is_shared_dir = view_utils.is_shared_dir(instance["path"])
         is_shared_path = view_utils.is_shared_path(instance["path"])
-        if is_shared_dir:
-            return False
-        elif is_shared_path:
+        if is_shared_path:
             return request.is_gateway_admin
         else:
             return True
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
index 31cb8d4b..2e4c2898 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
@@ -77,7 +77,11 @@
           <i class="fa fa-file-archive" aria-hidden="true"></i>
         </b-link>
         <delete-link
-          v-if="includeDeleteAction && data.item.userHasWriteAccess"
+          v-if="
+            includeDeleteAction &&
+            data.item.userHasWriteAccess &&
+            !data.item.isSharedDir
+          "
           @delete="deleteItem(data.item)"
         >
           Are you sure you want to delete <strong>{{ data.item.name }}</strong