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/07/13 00:18:12 UTC

[airavata-django-portal] 07/07: AIRAVATA-2835 Only allow owner to edit sharing settings

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 c579b8496022800aa6da135811cfa64136f7ab62
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Thu Jul 12 20:17:54 2018 -0400

    AIRAVATA-2835 Only allow owner to edit sharing settings
---
 django_airavata/static/common/js/components/ShareButton.vue | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/django_airavata/static/common/js/components/ShareButton.vue b/django_airavata/static/common/js/components/ShareButton.vue
index ff2e7a4..02edb02 100644
--- a/django_airavata/static/common/js/components/ShareButton.vue
+++ b/django_airavata/static/common/js/components/ShareButton.vue
@@ -1,6 +1,6 @@
 <template>
     <div id="share-button">
-        <b-button v-b-modal.modal-share-settings :variant="'outline-primary'" :title="title">
+        <b-button v-b-modal.modal-share-settings :variant="'outline-primary'" :title="title" :disabled="!shareButtonEnabled">
             Share
             <b-badge>{{ totalCount }}</b-badge>
         </b-button>
@@ -163,7 +163,11 @@ export default {
         },
         usersAndGroupsSuggestions: function() {
             return this.userSuggestions.concat(this.groupSuggestions);
-        }
+        },
+        shareButtonEnabled: function() {
+            // Enable share button if new entity or user is the entity's owner
+            return (!this.sharedEntity.entityId || this.sharedEntity.isOwner);
+        },
     },
     methods: {
         /**