Skip to content

Commit

Permalink
add isAdmin()
Browse files Browse the repository at this point in the history
  • Loading branch information
okauppinen committed Jul 19, 2023
1 parent 3075dac commit e414809
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

function (userData) {
this._loggedIn = false;
this._admin = false;
this._roles = [];
if (userData) {
this._firstName = userData.firstName;
Expand All @@ -53,6 +54,9 @@
if (userData.userUUID) {
this._loggedIn = true;
}
if (userData.admin === true) {
this._admin = true;
}
this._apiKey = userData.apikey;
}
}, {
Expand Down Expand Up @@ -145,6 +149,9 @@
isLoggedIn: function () {
return this._loggedIn;
},
isAdmin: function () {
return this._admin;
},
/**
* @method getRoles
* Roles for the user
Expand Down

0 comments on commit e414809

Please sign in to comment.