wixUsers.currentUser.getRoles() .then((roles) => {
console.log( ‘Received ’ +roles.length+ ’ roles’ );
for ( let i = 0 ; i < roles.length ; i++) {
console.log(roles[i]);
}
})
This only returns Roles, not the Badges with permissions. Plus it’s not like I can go just make another role that’s named the same thing. Permission Manager won’t allow the same name as a Badge for a Role.
Why have Badges with permissions and then not be able to query or use it as a Role? It’s just permission and that’s not helpful.
I guess it just better to query Badges because that’s the best solution for Front-End usability especially if your badges have permission associated with them.
I recommend updating Badges so that you can assign Role(s). NOT Permissions. This extra work in the backend because now I have to do a double verification. One for Roles, and one for Badges.
Also, I have yet to find Velo documentation that works with a for loop for checking badges.