mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-19 14:15:21 +02:00
refactor(users): remove member unlinking logic from ShowUsers component and update billing access check for owner role only
This commit is contained in:
@@ -235,9 +235,6 @@ export const ShowUsers = () => {
|
||||
return;
|
||||
}
|
||||
}
|
||||
await removeMember({
|
||||
memberId: member.id,
|
||||
});
|
||||
toast.success(
|
||||
"User unlinked successfully",
|
||||
);
|
||||
|
||||
@@ -395,8 +395,7 @@ const MENU: Menu = {
|
||||
url: "/dashboard/settings/billing",
|
||||
icon: CreditCard,
|
||||
// Only enabled for admins in cloud environments
|
||||
isEnabled: ({ auth, isCloud }) =>
|
||||
!!((auth?.role === "owner" || auth?.role === "admin") && isCloud),
|
||||
isEnabled: ({ auth, isCloud }) => !!(auth?.role === "owner" && isCloud),
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export async function getServerSideProps(
|
||||
}
|
||||
const { req, res } = ctx;
|
||||
const { user, session } = await validateRequest(req);
|
||||
if (!user || user.role === "member") {
|
||||
if (!user || user.role !== "owner") {
|
||||
return {
|
||||
redirect: {
|
||||
permanent: true,
|
||||
|
||||
Reference in New Issue
Block a user