mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-11-22 01:02:59 +01:00
🚑 Prevent Read Only user to send emergency stop
This commit is contained in:
parent
e80ec6916f
commit
fe22cb57c9
@ -43,16 +43,21 @@ $(function () {
|
||||
|
||||
};
|
||||
|
||||
this.hasControlPermition = function () {
|
||||
let user = this.loginState.currentUser()
|
||||
return user.permissions.includes("control") || user.needs.role.includes("control");
|
||||
}
|
||||
|
||||
this.big_button_visible = function () {
|
||||
return this.loginState.isUser() && this.settings.big_button();
|
||||
return this.loginState.isUser() && this.settings.big_button() && this.hasControlPermition();
|
||||
};
|
||||
|
||||
this.little_button_visible = function () {
|
||||
return this.loginState.isUser() && !this.settings.big_button();
|
||||
return this.loginState.isUser() && !this.settings.big_button() && this.hasControlPermition();
|
||||
};
|
||||
|
||||
this.can_send_command = function () {
|
||||
return this.loginState.isUser() && this.printerState.isOperational();
|
||||
return this.loginState.isUser() && this.hasControlPermition() && this.printerState.isOperational() ;
|
||||
};
|
||||
|
||||
this.little_button_css = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user