Skip to content

Commit

Permalink
fix policy has-permission.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Datayama38 committed Apr 12, 2024
1 parent efafd89 commit 34fb9d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cms/src/plugins/betagouv/admin/src/components/FlowCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const FlowCard = (props: {id: string}) => {

return (
<Box padding={4} hasRadius background="neutral0" shadow="tableShadow">
<Typography>{formatMessage({ id: getTrad(`flow-${props.id}`)})}</Typography>
<Button onClick={run} disabled={isLoading}>{formatMessage({ id: getTrad('action')})}</Button>
<Typography>{formatMessage({ id: getTrad(`flow-${props.id}`)})}</Typography>
<Button onClick={run} disabled={isLoading}>{formatMessage({ id: getTrad('action')})}</Button>
</Box>
);
};
Expand Down
1 change: 0 additions & 1 deletion cms/src/plugins/betagouv/admin/src/pages/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*
*/

import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { AnErrorOccurred } from '@strapi/helper-plugin';

Expand Down
4 changes: 1 addition & 3 deletions cms/src/plugins/betagouv/admin/src/pages/HomePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ const HomePage = () => {
/>
</Box>
<GridLayout>
<FlowCard id={'flush_cache'} />
<FlowCard id={'deploy'} />
{ !isLoading && flows.map((f,i) => <FlowCard id={f} key={i} />)}
{ !isLoading && flows.map((f) => <FlowCard id={f} key={f} />)}
</GridLayout>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion cms/src/plugins/betagouv/server/policies/has-permission.ts
Original file line number Diff line number Diff line change
@@ -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;
}

Expand Down

0 comments on commit 34fb9d9

Please sign in to comment.