Fix pages access incorrectly defined

This commit is contained in:
arttu
2024-07-09 21:42:26 +03:00
parent f64286fd58
commit ed5a7b6b0c
+2 -1
View File
@@ -71,7 +71,8 @@ export const Page = <T extends Record<string, unknown>>({
}) => {
const { id } = useParams()
const user = useUser()
if (allowedRoles && allowedRoles.includes(user.role)) return <Box>Your user is not authorized to view this page.</Box>
if (allowedRoles && !allowedRoles.includes(user.role))
return <Box>Your user is not authorized to view this page.</Box>
return (
<PageContextProvider<T> idFieldName={idFieldName as string} viewName={viewName} createTitle={createTitle}>
{id ? detailView : tableView}