From 34fb9d98e35dd6652a621a5c3959c015acded3d0 Mon Sep 17 00:00:00 2001 From: Ludovic Delhomme Date: Fri, 12 Apr 2024 10:46:49 +0200 Subject: [PATCH] fix policy has-permission.ts --- cms/src/plugins/betagouv/admin/src/components/FlowCard.tsx | 4 ++-- cms/src/plugins/betagouv/admin/src/pages/App/index.tsx | 1 - cms/src/plugins/betagouv/admin/src/pages/HomePage/index.tsx | 4 +--- cms/src/plugins/betagouv/server/policies/has-permission.ts | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cms/src/plugins/betagouv/admin/src/components/FlowCard.tsx b/cms/src/plugins/betagouv/admin/src/components/FlowCard.tsx index 1edbbacfd6..675b41193e 100644 --- a/cms/src/plugins/betagouv/admin/src/components/FlowCard.tsx +++ b/cms/src/plugins/betagouv/admin/src/components/FlowCard.tsx @@ -10,8 +10,8 @@ const FlowCard = (props: {id: string}) => { return ( - {formatMessage({ id: getTrad(`flow-${props.id}`)})} - + {formatMessage({ id: getTrad(`flow-${props.id}`)})} + ); }; diff --git a/cms/src/plugins/betagouv/admin/src/pages/App/index.tsx b/cms/src/plugins/betagouv/admin/src/pages/App/index.tsx index 862493fe02..1380b49eb3 100644 --- a/cms/src/plugins/betagouv/admin/src/pages/App/index.tsx +++ b/cms/src/plugins/betagouv/admin/src/pages/App/index.tsx @@ -5,7 +5,6 @@ * */ -import React from 'react'; import { Switch, Route } from 'react-router-dom'; import { AnErrorOccurred } from '@strapi/helper-plugin'; diff --git a/cms/src/plugins/betagouv/admin/src/pages/HomePage/index.tsx b/cms/src/plugins/betagouv/admin/src/pages/HomePage/index.tsx index d4400077f6..d71bc3d9cf 100644 --- a/cms/src/plugins/betagouv/admin/src/pages/HomePage/index.tsx +++ b/cms/src/plugins/betagouv/admin/src/pages/HomePage/index.tsx @@ -17,9 +17,7 @@ const HomePage = () => { /> - - - { !isLoading && flows.map((f,i) => )} + { !isLoading && flows.map((f) => )} ); diff --git a/cms/src/plugins/betagouv/server/policies/has-permission.ts b/cms/src/plugins/betagouv/server/policies/has-permission.ts index d9a759481c..906ec0c15a 100644 --- a/cms/src/plugins/betagouv/server/policies/has-permission.ts +++ b/cms/src/plugins/betagouv/server/policies/has-permission.ts @@ -1,5 +1,5 @@ export default (policyContext, config, { strapi }) => { - if (policyContext.state.user && policyContext.state.user.roles.includes('Authenticated')) { + if (policyContext.state.user && policyContext.state.user.isActive) { return true; }