Compare commits

...

1 Commits

Author SHA1 Message Date
Firman Ramdhani 29ff09d3aa feat: add setting access to change setting data 2025-05-16 10:07:20 +07:00
1 changed files with 16 additions and 1 deletions

View File

@ -33,6 +33,13 @@ export default function AdminLayout(props: AdminLayoutProps) {
}
}
function checkAllowAccessSetting() {
const username = user?.username;
const allowList = ['Endy', 'superadmin'];
if (allowList.includes(username)) return true;
return false;
}
return (
<Layout>
<Header
@ -81,7 +88,15 @@ export default function AdminLayout(props: AdminLayoutProps) {
});
},
},
],
]
.map((item) => {
const isAllowSetting = checkAllowAccessSetting();
if (!isAllowSetting && (item.key === '1' || item.type === 'divider')) {
return undefined;
}
return item;
})
.filter(Boolean) as any,
}}
>
<Avatar size={35} style={{ cursor: 'pointer' }}>