| @@ -28,7 +28,7 @@ const Projects: React.FC = async () => { | |||||
| const abilities = await getUserAbilities() | const abilities = await getUserAbilities() | ||||
| if (!abilities.includes(MAINTAIN_PROJECT)) { | |||||
| if (![MAINTAIN_PROJECT].some(ability => abilities.includes(ability))) { | |||||
| notFound(); | notFound(); | ||||
| } | } | ||||
| @@ -30,9 +30,9 @@ const Projects: React.FC = async () => { | |||||
| const { t } = await getServerI18n("projects"); | const { t } = await getServerI18n("projects"); | ||||
| const abilities = await getUserAbilities() | const abilities = await getUserAbilities() | ||||
| if (!abilities.includes(MAINTAIN_PROJECT)) { | |||||
| if (![MAINTAIN_PROJECT].some(ability => abilities.includes(ability))) { | |||||
| notFound(); | notFound(); | ||||
| } | |||||
| } | |||||
| // Preload necessary dependencies | // Preload necessary dependencies | ||||
| fetchAllTasks(); | fetchAllTasks(); | ||||
| @@ -36,7 +36,7 @@ const Projects: React.FC<Props> = async ({ searchParams }) => { | |||||
| const projectId = searchParams["id"]; | const projectId = searchParams["id"]; | ||||
| const abilities = await getUserAbilities() | const abilities = await getUserAbilities() | ||||
| if (!projectId || isArray(projectId) || abilities.includes(MAINTAIN_PROJECT)) { | |||||
| if (!projectId || isArray(projectId) || ![MAINTAIN_PROJECT].some(ability => abilities.includes(ability))) { | |||||
| notFound(); | notFound(); | ||||
| } | } | ||||