allow to lock own artefacts as an editor (#132)

* allow to lock own artefacts as an editor
This commit is contained in:
banglashi
2020-11-23 12:10:35 +01:00
committed by GitHub
parent c9b6e7c2c8
commit 5a7839ceaa
2 changed files with 13 additions and 5 deletions

View File

@@ -182,7 +182,8 @@ var SpacedeckSections = {
toolbar_props_in: false,
toolbar_artifacts_x: "-1000px",
toolbar_artifacts_y: "-1000px",
toolbar_artifacts_in: true
toolbar_artifacts_in: true,
toolbar_lock_in: false
},
methods: {
@@ -848,7 +849,7 @@ var SpacedeckSections = {
if (!a) return false;
if (!this.active_space) return false;
if (this.active_space_role=="viewer" || (a.locked && this.active_space_role!="admin")) {
if (this.active_space_role=="viewer" || (a.locked && this.active_space_role=="viewer")) {
return false;
}
@@ -2526,11 +2527,18 @@ var SpacedeckSections = {
},
show_toolbar_props: function() {
if (this.selection_metrics.count==0) return;
if (this.selection_metrics.count==0) {
this.toolbar_lock_in = false;
return;
}
arts = this.selected_artifacts();
// check if selected artifacts are all from the same user
let same_user = true;
for (var i=0;i<arts.length; i++) {
if (arts[i].mime=="x-spacedeck/zone") return;
if (arts[i].user_id!==this.user._id) same_user = false;
}
this.toolbar_lock_in = same_user;
this.toolbar_props_in = true;
},