mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-11-25 02:32:59 +01:00
🚑 Check if permissions is defined for octoprint version < 1.4.0 #16
This commit is contained in:
parent
30b486a4f0
commit
55ac690469
@ -44,9 +44,13 @@ $(function () {
|
||||
};
|
||||
|
||||
this.hasControlPermition = function () {
|
||||
let user = this.loginState.currentUser()
|
||||
let user = this.loginState.currentUser();
|
||||
if(user.permissions !== undefined){
|
||||
return user.permissions.includes("control") || user.needs.role.includes("control");
|
||||
}
|
||||
else return true;
|
||||
|
||||
}
|
||||
|
||||
this.big_button_visible = function () {
|
||||
return this.loginState.isUser() && this.settings.big_button() && this.hasControlPermition();
|
||||
|
Loading…
Reference in New Issue
Block a user