From 86ac9ca9562dae2cdc56048f2deb80de4df82f7b Mon Sep 17 00:00:00 2001 From: Oleg Zharkov Date: Thu, 11 Feb 2021 16:00:18 +0100 Subject: [PATCH 1/9] first implementation --- .../LibraryFolder/LibraryFolder.vue | 2 +- .../LibraryFolderDatasetPermissions.vue | 148 ++++++++++++++++++ .../LibraryFolderPermissions.vue | 127 +++++---------- .../LibraryPermissionsWarning.vue | 25 +++ .../PermissionsInputField.vue | 71 ++++++--- .../LibraryFolderPermissions/services.js | 23 ++- .../LibraryFolderPermissions/utils.js | 9 ++ .../LibraryFolder/LibraryFolderRouter.vue | 9 +- client/src/entry/analysis/AnalysisRouter.js | 1 + lib/galaxy/webapps/galaxy/buildapp.py | 1 + 10 files changed, 308 insertions(+), 108 deletions(-) create mode 100644 client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderDatasetPermissions.vue create mode 100644 client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryPermissionsWarning.vue create mode 100644 client/src/components/LibraryFolder/LibraryFolderPermissions/utils.js diff --git a/client/src/components/LibraryFolder/LibraryFolder.vue b/client/src/components/LibraryFolder/LibraryFolder.vue index 10248d84889..432402730e7 100644 --- a/client/src/components/LibraryFolder/LibraryFolder.vue +++ b/client/src/components/LibraryFolder/LibraryFolder.vue @@ -461,7 +461,7 @@ export default { else if (element.type === "folder") return `${this.root}library/folders/${element.id}`; }, navigateToPermission(element) { - if (element.type === "file") window.location.replace(`${this.createContentLink(element)}/permissions`); + if (element.type === "file") this.$router.push({ path: `/permissions/${this.folder_id}/dataset/${element.id}` }) else if (element.type === "folder") this.$router.push({ path: `/permissions/${element.id}` }); }, getMessage(element) { diff --git a/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderDatasetPermissions.vue b/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderDatasetPermissions.vue new file mode 100644 index 00000000000..c5abd0db36b --- /dev/null +++ b/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderDatasetPermissions.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderPermissions.vue b/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderPermissions.vue index 982ef7bd18e..8f1340681e2 100644 --- a/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderPermissions.vue +++ b/client/src/components/LibraryFolder/LibraryFolderPermissions/LibraryFolderPermissions.vue @@ -9,77 +9,44 @@
{{ folder.name }}
-
-
- - You are logged in as an administrator therefore you can manage any folder on - this Galaxy instance. Please make sure you understand the consequences. - - - You can assign any number of roles to any of the following permission types. However please read - carefully the implications of such actions. - -
-
+
-

Folder permissions

-

- Roles that can manage permissions on this folder -

- - - - - - User with any of these roles can manage permissions on this folder. - - - -

- Roles that can add items to this folder -

- - - - - - User with any of these roles can add items to this folder (folders and - datasets). - - - -

- Roles that can modify this folder -

- - - - - - User with any of these roles can modify this folder (name, etc.). - - +

Folder permissions

+ + + + + - -
- - - - -

Dataset: <%= _.escape(item.get("name")) %>

-
- <% if (is_admin) { %> - You are logged in as an administrator therefore you can manage any dataset - on this Galaxy instance. Please make sure you understand the consequences. - <% } else { %> - You can assign any number of roles to any of the following permission types. However please - read carefully the implications of such actions. - <% } %> -
-
-

Library-related permissions

-

Roles that can modify the library item

-
-
- User with any of these roles can modify name, metadata, - and other information about this library item. -
-
-

Dataset-related permissions

-
- Changes made below will affect every library item that was created from - this dataset and also every history this dataset is part of. -
- <% if (!item.get("is_unrestricted")) { %> -

- You can - remove all access restrictions on this dataset. -

- <% } else { %> -

- You can - make this dataset private to you.

- <% } %> -

Roles that can access the dataset

-
-
- User has to have all these roles in order to access this dataset. - Users without access permission cannot have other permissions on this dataset. - If there are no access roles set on the dataset it is considered unrestricted. -
-

Roles that can manage permissions on the dataset

-
-
- User with any of these roles can manage permissions of this dataset. - If you remove yourself you will lose the ability manage this dataset unless you are an admin. -
- -
- - ` - ); - }, - templateBulkImportInModal: function () { return _.template( `
From 18fb62508b394b5da0834487a1940c7b4f4bcc69 Mon Sep 17 00:00:00 2001 From: Oleg Zharkov Date: Mon, 15 Feb 2021 14:37:19 +0200 Subject: [PATCH 8/9] fix permissions button in dataset details view --- client/src/mvc/library/library-dataset-view.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/mvc/library/library-dataset-view.js b/client/src/mvc/library/library-dataset-view.js index 7d8078c1f76..f0ba308722d 100644 --- a/client/src/mvc/library/library-dataset-view.js +++ b/client/src/mvc/library/library-dataset-view.js @@ -73,9 +73,7 @@ var LibraryDatasetView = Backbone.View.extend({ var self = this; this.model.fetch({ success: function () { - if (self.options.show_permissions) { - self.showPermissions(); - } else if (self.options.show_version) { + if (self.options.show_version) { self.fetchVersion(); } else { self.render(); @@ -489,7 +487,7 @@ var LibraryDatasetView = Backbone.View.extend({ <% } %> <% if (item.get("can_user_manage")) { %> - /datasets/<%- item.id %>/permissions"> + /dataset/<%- item.id %>">