mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-11-21 16:52: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,8 +44,12 @@ $(function () {
|
||||
};
|
||||
|
||||
this.hasControlPermition = function () {
|
||||
let user = this.loginState.currentUser()
|
||||
return user.permissions.includes("control") || user.needs.role.includes("control");
|
||||
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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user