Skip to content

Commit dfa3182

Browse files
toolbar: disable buttons according to permissions (#2335)
* Closes #2327
1 parent 96e4905 commit dfa3182

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

changes.d/2335.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The play, pause and stop buttons in the workspace toolbar will now "grey out" if you do not have the permissions to run these commands.

src/components/cylc/workspace/Toolbar.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ export default {
387387
return {
388388
playToggle: (
389389
// the play button (for the play from stopped scenario)
390+
this.user.permissions.includes('play') &&
390391
this.isStopped &&
391392
(
392393
this.expecting.play === null ||
@@ -395,6 +396,10 @@ export default {
395396
),
396397
pauseToggle: (
397398
// the play/pause button
399+
(
400+
(this.isPaused && this.user.permissions.includes('resume')) ||
401+
(!this.isPaused && this.user.permissions.includes('pause'))
402+
) &&
398403
!this.isStopped &&
399404
!this.expecting.stop &&
400405
this.currentWorkflow.node.status !== WorkflowState.STOPPING.name &&
@@ -405,6 +410,7 @@ export default {
405410
),
406411
stopToggle: (
407412
// the stop button
413+
this.user.permissions.includes('stop') &&
408414
!this.isStopped &&
409415
(
410416
this.expecting.stop === null ||

0 commit comments

Comments
 (0)