🚑 Check if permissions is defined for octoprint version < 1.4.0 #16

This commit is contained in:
Sebastien Clement 2020-11-23 11:40:57 +01:00
parent 30b486a4f0
commit 55ac690469

View File

@ -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 () {