mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add org roles verification
This commit is contained in:
parent
42c99f3939
commit
fac56f0c7e
2 changed files with 31 additions and 16 deletions
|
|
@ -24,9 +24,9 @@ export const AuthenticatedClientElement = (props: AuthenticatedClientElementProp
|
|||
const user_roles = auth.userInfo.user_object.roles;
|
||||
const org_role = org_roles.find((org: any) => org.org_id == org_id);
|
||||
const user_role = user_roles.find((role: any) => role.org_id == org_id);
|
||||
|
||||
|
||||
if (org_role && user_role) {
|
||||
if (org_roles_values.includes(org_role.org_role) && user_roles_values.includes(user_role.role_id)) {
|
||||
if (org_roles_values.includes(org_role.org_role) || user_roles_values.includes(user_role.role_id)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue