Unverified Commit 40c075d7 authored by Gung Wah's avatar Gung Wah Committed by GitHub
Browse files

[FIX] Cannot read property 'some' of undefined on hasPermission (#2966)


Co-authored-by: default avatarDiego Mello <diegolmello@gmail.com>
parent e35f7fe5
......@@ -1192,7 +1192,7 @@ const RocketChat = {
// get user roles on the server from redux
const userRoles = (shareUser?.roles || loginUser?.roles) || [];
const mergedRoles = [...new Set([...roomRoles, ...userRoles])];
return permissions.map(permission => permission.some(r => mergedRoles.includes(r) ?? false));
return permissions.map(permission => permission?.some(r => mergedRoles.includes(r) ?? false));
} catch (e) {
log(e);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment