I have some code that I use to check permissions of users and see if they’re able to see some buttons. It used to work for months, now it doesnt anymore.
user.getRoles()
.then( (roles) => {
//console.log("check roles here: " + roles)
if(roles.length > 0) {
let firstRole = roles[0];
let checkRole = firstRole.name;
console.log("Role is " + checkRole);
if (checkRole === 'SALES' || checkRole === 'Admin'){
//console.log("checkRole is " + checkRole);
$w("#buttonCompMonitoring").expand();
//$w("#requestToair").expand();
}
I have a similar setup on my site and checked my page as soon as I saw this post, and the same “missing Admin” problem happens for me
Hopefully someone from Wix can look into it as a bug and/or provide a fix