Skip to content

Commit c668b36

Browse files
committed
Snapshot actions available only for users with appropriate permission
1 parent 6282582 commit c668b36

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

js/pages/concept-sets/conceptset-manager.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- ko if: $component.currentConceptSet().id != null && $component.currentConceptSet().id != 0 -->
2727
<button type="button" class="btn btn-primary" data-bind="click: () => isTagsModalShown(!isTagsModalShown()), visible: canEdit() && !previewVersion(), css: { disabled: isProcessing() }, title: ko.i18n('common.tags', 'Tags')"><i class="fa fa-tags"></i></button>
2828
<button type="button" class="btn btn-primary" data-bind="visible: !previewVersion(), click: optimize, css: { disabled: !canOptimize() || isProcessing() }, text: ko.i18n('cs.manager.optimize', 'Optimize')"></button>
29-
<button type="button" class="btn btn-primary" data-bind="click: lockOrUnlockSnapshot,
29+
<button type="button" class="btn btn-primary" data-bind="visible: isAllowedSnapshotActions(), click: lockOrUnlockSnapshot,
3030
css: {
3131
'btn-lock-locked': isLocked(),
3232
'btn-lock-unlocked': !isLocked(),

js/pages/concept-sets/conceptset-manager.js

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ define([
8686
this.currentConceptSetMode = sharedState.currentConceptSetMode;
8787
this.isOptimizeModalShown = ko.observable(false);
8888
this.isSnapshotLockModalShown = ko.observable(false);
89+
this.isAllowedSnapshotActions = ko.computed(() => {
90+
return authApi.isPermitted('conceptset:*:snapshot:post');
91+
})
8992
this.defaultName = ko.unwrap(globalConstants.newEntityNames.conceptSet);
9093
this.loading = ko.observable();
9194
this.optimizeLoading = ko.observable();

0 commit comments

Comments
 (0)