fix admin access for org
This commit is contained in:
@@ -33,6 +33,7 @@ export default async function Page({
|
|||||||
members: {
|
members: {
|
||||||
select: {
|
select: {
|
||||||
role: true,
|
role: true,
|
||||||
|
userId: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -42,7 +43,11 @@ export default async function Page({
|
|||||||
return notFound();
|
return notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasAccess = organization.members[0]?.role === 'org:admin';
|
const member = organization.members.find(
|
||||||
|
(member) => member.userId === session.userId
|
||||||
|
);
|
||||||
|
|
||||||
|
const hasAccess = member?.role === 'org:admin';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user