mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-08-18 13:54:56 +02: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 () {
|
this.hasControlPermition = function () {
|
||||||
let user = this.loginState.currentUser()
|
let user = this.loginState.currentUser();
|
||||||
return user.permissions.includes("control") || user.needs.role.includes("control");
|
if(user.permissions !== undefined){
|
||||||
|
return user.permissions.includes("control") || user.needs.role.includes("control");
|
||||||
|
}
|
||||||
|
else return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.big_button_visible = function () {
|
this.big_button_visible = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user