Skip to content

Commit

Permalink
🚑 Check if permissions is defined for octoprint version < 1.4.0 #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebclem committed Nov 23, 2020
1 parent 30b486a commit 55ac690
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 55ac690

Please sign in to comment.