[FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
e35f7fe583
commit
40c075d748
|
@ -1192,7 +1192,7 @@ const RocketChat = {
|
||||||
// get user roles on the server from redux
|
// get user roles on the server from redux
|
||||||
const userRoles = (shareUser?.roles || loginUser?.roles) || [];
|
const userRoles = (shareUser?.roles || loginUser?.roles) || [];
|
||||||
const mergedRoles = [...new Set([...roomRoles, ...userRoles])];
|
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) {
|
} catch (e) {
|
||||||
log(e);
|
log(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue