2020-08-03 16:49:40 +02:00
|
|
|
import React from 'react';
|
2020-08-04 15:15:08 +02:00
|
|
|
import { Switch, Route } from 'react-router-dom';
|
2023-04-11 10:03:32 +02:00
|
|
|
import { CheckPagePermissions, AnErrorOccurred } from '@strapi/helper-plugin';
|
2020-08-04 13:07:55 +02:00
|
|
|
import pluginId from '../../pluginId';
|
2021-07-28 08:16:15 +02:00
|
|
|
import pluginPermissions from '../../permissions';
|
2020-08-04 15:15:08 +02:00
|
|
|
import ProtectedRolesListPage from './ProtectedListPage';
|
2020-08-04 13:07:55 +02:00
|
|
|
import ProtectedRolesEditPage from './ProtectedEditPage';
|
|
|
|
|
import ProtectedRolesCreatePage from './ProtectedCreatePage';
|
|
|
|
|
|
|
|
|
|
const Roles = () => {
|
|
|
|
|
return (
|
2021-07-28 08:16:15 +02:00
|
|
|
<CheckPagePermissions permissions={pluginPermissions.accessRoles}>
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route
|
|
|
|
|
path={`/settings/${pluginId}/roles/new`}
|
|
|
|
|
component={ProtectedRolesCreatePage}
|
|
|
|
|
exact
|
|
|
|
|
/>
|
|
|
|
|
<Route path={`/settings/${pluginId}/roles/:id`} component={ProtectedRolesEditPage} exact />
|
|
|
|
|
<Route path={`/settings/${pluginId}/roles`} component={ProtectedRolesListPage} exact />
|
2023-04-11 10:03:32 +02:00
|
|
|
<Route path="" component={AnErrorOccurred} />
|
2021-07-28 08:16:15 +02:00
|
|
|
</Switch>
|
|
|
|
|
</CheckPagePermissions>
|
2020-08-04 13:07:55 +02:00
|
|
|
);
|
2020-08-03 16:49:40 +02:00
|
|
|
};
|
|
|
|
|
|
2020-08-04 13:07:55 +02:00
|
|
|
export default Roles;
|