refactor: enhance user role handling in List and ability definitions
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ export function defineAbilitiesFor(user) {
|
||||
cannot("access", "Login");
|
||||
const parsedData = JSON.parse(user.value);
|
||||
|
||||
if (parsedData.roles.find((item) => item === "representation")) {
|
||||
if (parsedData.roles && Object.values(parsedData.roles).includes("representation")) {
|
||||
can("access", "Panel");
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user