mirror of
https://github.com/strapi/strapi.git
synced 2025-11-30 17:18:24 +00:00
28 lines
1009 B
JavaScript
28 lines
1009 B
JavaScript
import React from 'react';
|
|
import { Switch, Route } from 'react-router-dom';
|
|
import { CheckPagePermissions, AnErrorOccurred } from '@strapi/helper-plugin';
|
|
import pluginId from '../../pluginId';
|
|
import pluginPermissions from '../../permissions';
|
|
import ProtectedRolesListPage from './ProtectedListPage';
|
|
import ProtectedRolesEditPage from './ProtectedEditPage';
|
|
import ProtectedRolesCreatePage from './ProtectedCreatePage';
|
|
|
|
const Roles = () => {
|
|
return (
|
|
<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 />
|
|
<Route path="" component={AnErrorOccurred} />
|
|
</Switch>
|
|
</CheckPagePermissions>
|
|
);
|
|
};
|
|
|
|
export default Roles;
|