@strapi/plugin-users-permissions 0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71 → 0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.eslintignore +1 -2
  2. package/.eslintrc +14 -0
  3. package/admin/src/components/BoundRoute/index.js +5 -3
  4. package/admin/src/components/FormModal/Input/index.js +6 -3
  5. package/admin/src/components/FormModal/index.js +13 -10
  6. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.js +1 -1
  7. package/admin/src/components/Permissions/PermissionRow/SubCategory.js +26 -5
  8. package/admin/src/components/Permissions/PermissionRow/index.js +4 -2
  9. package/admin/src/components/Permissions/index.js +6 -5
  10. package/admin/src/components/Policies/index.js +3 -2
  11. package/admin/src/components/UsersPermissions/index.js +8 -5
  12. package/admin/src/{permissions.js → constants.js} +1 -3
  13. package/admin/src/contexts/UsersPermissionsContext/index.js +1 -0
  14. package/admin/src/index.js +19 -28
  15. package/admin/src/pages/AdvancedSettings/index.js +68 -52
  16. package/admin/src/pages/AdvancedSettings/utils/schema.js +1 -1
  17. package/admin/src/pages/EmailTemplates/components/EmailForm.js +14 -13
  18. package/admin/src/pages/EmailTemplates/components/EmailTable.js +9 -7
  19. package/admin/src/pages/EmailTemplates/index.js +77 -63
  20. package/admin/src/pages/EmailTemplates/utils/schema.js +1 -1
  21. package/admin/src/pages/Providers/index.js +91 -86
  22. package/admin/src/pages/Providers/utils/forms.js +1 -1
  23. package/admin/src/pages/Roles/{CreatePage/utils/schema.js → constants.js} +2 -4
  24. package/admin/src/pages/Roles/hooks/usePlugins.js +78 -0
  25. package/admin/src/pages/Roles/index.js +17 -11
  26. package/admin/src/pages/Roles/pages/CreatePage.js +199 -0
  27. package/admin/src/pages/Roles/pages/EditPage.js +220 -0
  28. package/admin/src/pages/Roles/{ListPage → pages/ListPage}/components/TableBody.js +46 -15
  29. package/admin/src/pages/Roles/{ListPage → pages/ListPage}/index.js +48 -47
  30. package/admin/src/pages/Roles/{ListPage → pages/ListPage}/utils/api.js +3 -4
  31. package/admin/src/translations/ru.json +50 -26
  32. package/admin/src/translations/zh-Hans.json +80 -80
  33. package/admin/src/utils/index.js +1 -2
  34. package/documentation/content-api.yaml +23 -15
  35. package/jest.config.front.js +2 -0
  36. package/package.json +47 -30
  37. package/packup.config.ts +42 -0
  38. package/server/bootstrap/index.js +36 -0
  39. package/server/controllers/auth.js +51 -14
  40. package/server/controllers/user.js +12 -1
  41. package/server/middlewares/rateLimit.js +41 -21
  42. package/server/register.js +7 -1
  43. package/server/services/providers-registry.js +1 -1
  44. package/server/strategies/users-permissions.js +1 -8
  45. package/.eslintrc.js +0 -14
  46. package/admin/src/hooks/index.js +0 -5
  47. package/admin/src/hooks/useFetchRole/index.js +0 -64
  48. package/admin/src/hooks/useFetchRole/reducer.js +0 -31
  49. package/admin/src/hooks/useForm/index.js +0 -70
  50. package/admin/src/hooks/useForm/reducer.js +0 -40
  51. package/admin/src/hooks/usePlugins/index.js +0 -67
  52. package/admin/src/hooks/usePlugins/init.js +0 -5
  53. package/admin/src/hooks/usePlugins/reducer.js +0 -34
  54. package/admin/src/hooks/useRolesList/index.js +0 -63
  55. package/admin/src/hooks/useRolesList/init.js +0 -5
  56. package/admin/src/hooks/useRolesList/reducer.js +0 -31
  57. package/admin/src/pages/AdvancedSettings/utils/api.js +0 -17
  58. package/admin/src/pages/EmailTemplates/utils/api.js +0 -17
  59. package/admin/src/pages/Providers/reducer.js +0 -54
  60. package/admin/src/pages/Providers/utils/api.js +0 -25
  61. package/admin/src/pages/Providers/utils/createProvidersArray.js +0 -21
  62. package/admin/src/pages/Roles/CreatePage/index.js +0 -182
  63. package/admin/src/pages/Roles/EditPage/index.js +0 -194
  64. package/admin/src/pages/Roles/EditPage/utils/schema.js +0 -9
  65. package/admin/src/pages/Roles/ProtectedCreatePage/index.js +0 -12
  66. package/admin/src/pages/Roles/ProtectedEditPage/index.js +0 -12
  67. package/admin/src/pages/Roles/ProtectedListPage/index.js +0 -15
  68. package/admin/src/utils/getRequestURL.js +0 -5
  69. package/strapi-admin.js +0 -3
@@ -1,63 +0,0 @@
1
- import { useEffect, useReducer, useRef } from 'react';
2
- import { request, useNotification } from '@strapi/helper-plugin';
3
- import get from 'lodash/get';
4
- import init from './init';
5
- import pluginId from '../../pluginId';
6
- import reducer, { initialState } from './reducer';
7
-
8
- const useRolesList = (shouldFetchData = true) => {
9
- const [{ roles, isLoading }, dispatch] = useReducer(reducer, initialState, () =>
10
- init(initialState, shouldFetchData)
11
- );
12
- const toggleNotification = useNotification();
13
-
14
- const isMounted = useRef(true);
15
- const abortController = new AbortController();
16
- const { signal } = abortController;
17
-
18
- useEffect(() => {
19
- if (shouldFetchData) {
20
- fetchRolesList();
21
- }
22
-
23
- return () => {
24
- abortController.abort();
25
- isMounted.current = false;
26
- };
27
- // eslint-disable-next-line react-hooks/exhaustive-deps
28
- }, [shouldFetchData]);
29
-
30
- const fetchRolesList = async () => {
31
- try {
32
- dispatch({
33
- type: 'GET_DATA',
34
- });
35
-
36
- const { roles } = await request(`/${pluginId}/roles`, { method: 'GET', signal });
37
-
38
- dispatch({
39
- type: 'GET_DATA_SUCCEEDED',
40
- data: roles,
41
- });
42
- } catch (err) {
43
- const message = get(err, ['response', 'payload', 'message'], 'An error occured');
44
-
45
- if (isMounted.current) {
46
- dispatch({
47
- type: 'GET_DATA_ERROR',
48
- });
49
-
50
- if (message !== 'Forbidden') {
51
- toggleNotification({
52
- type: 'warning',
53
- message,
54
- });
55
- }
56
- }
57
- }
58
- };
59
-
60
- return { roles, isLoading, getData: fetchRolesList };
61
- };
62
-
63
- export default useRolesList;
@@ -1,5 +0,0 @@
1
- const init = (initialState, shouldFetchData) => {
2
- return { ...initialState, isLoading: shouldFetchData };
3
- };
4
-
5
- export default init;
@@ -1,31 +0,0 @@
1
- /* eslint-disable consistent-return */
2
- import produce from 'immer';
3
-
4
- export const initialState = {
5
- roles: [],
6
- isLoading: true,
7
- };
8
-
9
- const reducer = (state, action) =>
10
- produce(state, (draftState) => {
11
- switch (action.type) {
12
- case 'GET_DATA': {
13
- draftState.isLoading = true;
14
- draftState.roles = [];
15
- break;
16
- }
17
- case 'GET_DATA_SUCCEEDED': {
18
- draftState.roles = action.data;
19
- draftState.isLoading = false;
20
- break;
21
- }
22
- case 'GET_DATA_ERROR': {
23
- draftState.isLoading = false;
24
- break;
25
- }
26
- default:
27
- return draftState;
28
- }
29
- });
30
-
31
- export default reducer;
@@ -1,17 +0,0 @@
1
- import { getFetchClient } from '@strapi/helper-plugin';
2
- import { getRequestURL } from '../../../utils';
3
-
4
- const fetchData = async () => {
5
- const { get } = getFetchClient();
6
- const { data } = await get(getRequestURL('advanced'));
7
-
8
- return data;
9
- };
10
-
11
- const putAdvancedSettings = (body) => {
12
- const { put } = getFetchClient();
13
-
14
- return put(getRequestURL('advanced'), body);
15
- };
16
-
17
- export { fetchData, putAdvancedSettings };
@@ -1,17 +0,0 @@
1
- import { getFetchClient } from '@strapi/helper-plugin';
2
- import { getRequestURL } from '../../../utils';
3
-
4
- const fetchData = async () => {
5
- const { get } = getFetchClient();
6
- const { data } = await get(getRequestURL('email-templates'));
7
-
8
- return data;
9
- };
10
-
11
- const putEmailTemplate = (body) => {
12
- const { put } = getFetchClient();
13
-
14
- return put(getRequestURL('email-templates'), body);
15
- };
16
-
17
- export { fetchData, putEmailTemplate };
@@ -1,54 +0,0 @@
1
- import produce from 'immer';
2
- import set from 'lodash/set';
3
-
4
- const initialState = {
5
- formErrors: {},
6
- isLoading: true,
7
- initialData: {},
8
- modifiedData: {},
9
- };
10
-
11
- const reducer = (state, action) =>
12
- // eslint-disable-next-line consistent-return
13
- produce(state, (draftState) => {
14
- switch (action.type) {
15
- case 'GET_DATA': {
16
- draftState.isLoading = true;
17
- draftState.initialData = {};
18
- draftState.modifiedData = {};
19
-
20
- break;
21
- }
22
-
23
- case 'GET_DATA_SUCCEEDED': {
24
- draftState.isLoading = false;
25
- draftState.initialData = action.data;
26
- draftState.modifiedData = action.data;
27
-
28
- break;
29
- }
30
- case 'GET_DATA_ERROR': {
31
- draftState.isLoading = true;
32
- break;
33
- }
34
- case 'ON_CHANGE': {
35
- set(draftState, ['modifiedData', ...action.keys.split('.')], action.value);
36
- break;
37
- }
38
- case 'RESET_FORM': {
39
- draftState.modifiedData = state.initialData;
40
- draftState.formErrors = {};
41
- break;
42
- }
43
- case 'SET_ERRORS': {
44
- draftState.formErrors = action.errors;
45
- break;
46
- }
47
- default: {
48
- return draftState;
49
- }
50
- }
51
- });
52
-
53
- export default reducer;
54
- export { initialState };
@@ -1,25 +0,0 @@
1
- import { getFetchClient } from '@strapi/helper-plugin';
2
- import { getRequestURL } from '../../../utils';
3
-
4
- // eslint-disable-next-line import/prefer-default-export
5
- export const fetchData = async (toggleNotification) => {
6
- try {
7
- const { get } = getFetchClient();
8
- const { data } = await get(getRequestURL('providers'));
9
-
10
- return data;
11
- } catch (err) {
12
- toggleNotification({
13
- type: 'warning',
14
- message: { id: 'notification.error' },
15
- });
16
-
17
- throw new Error('error');
18
- }
19
- };
20
-
21
- export const putProvider = (body) => {
22
- const { put } = getFetchClient();
23
-
24
- return put(getRequestURL('providers'), body);
25
- };
@@ -1,21 +0,0 @@
1
- import sortBy from 'lodash/sortBy';
2
-
3
- const createProvidersArray = (data) => {
4
- return sortBy(
5
- Object.keys(data).reduce((acc, current) => {
6
- const { icon: iconName, enabled, subdomain } = data[current];
7
- const icon = iconName === 'envelope' ? ['fas', 'envelope'] : ['fab', iconName];
8
-
9
- if (subdomain !== undefined) {
10
- acc.push({ name: current, icon, enabled, subdomain });
11
- } else {
12
- acc.push({ name: current, icon, enabled });
13
- }
14
-
15
- return acc;
16
- }, []),
17
- 'name'
18
- );
19
- };
20
-
21
- export default createProvidersArray;
@@ -1,182 +0,0 @@
1
- import React, { useState, useRef } from 'react';
2
- import { useHistory } from 'react-router-dom';
3
- import {
4
- ContentLayout,
5
- HeaderLayout,
6
- Main,
7
- Button,
8
- Flex,
9
- Box,
10
- TextInput,
11
- Textarea,
12
- Typography,
13
- GridItem,
14
- Grid,
15
- } from '@strapi/design-system';
16
- import { Check } from '@strapi/icons';
17
- import { Formik } from 'formik';
18
- import { useIntl } from 'react-intl';
19
- import {
20
- useOverlayBlocker,
21
- SettingsPageTitle,
22
- useFetchClient,
23
- useTracking,
24
- Form,
25
- useNotification,
26
- } from '@strapi/helper-plugin';
27
- import UsersPermissions from '../../../components/UsersPermissions';
28
- import getTrad from '../../../utils/getTrad';
29
- import pluginId from '../../../pluginId';
30
- import { usePlugins } from '../../../hooks';
31
- import schema from './utils/schema';
32
-
33
- const EditPage = () => {
34
- const { formatMessage } = useIntl();
35
- const [isSubmitting, setIsSubmitting] = useState(false);
36
- const toggleNotification = useNotification();
37
- const { goBack } = useHistory();
38
- const { lockApp, unlockApp } = useOverlayBlocker();
39
- const { isLoading: isLoadingPlugins, permissions, routes } = usePlugins();
40
- const { trackUsage } = useTracking();
41
- const permissionsRef = useRef();
42
- const { post } = useFetchClient();
43
-
44
- const handleCreateRoleSubmit = async (data) => {
45
- // Set loading state
46
- lockApp();
47
- setIsSubmitting(true);
48
- try {
49
- const permissions = permissionsRef.current.getPermissions();
50
- // Update role in Strapi
51
- await post(`/${pluginId}/roles`, { ...data, ...permissions, users: [] });
52
- // Notify success
53
- trackUsage('didCreateRole');
54
- toggleNotification({
55
- type: 'success',
56
- message: {
57
- id: getTrad('Settings.roles.created'),
58
- defaultMessage: 'Role created',
59
- },
60
- });
61
- // Forcing redirecting since we don't have the id in the response
62
- goBack();
63
- } catch (err) {
64
- console.error(err);
65
- toggleNotification({
66
- type: 'warning',
67
- message: {
68
- id: 'notification.error',
69
- defaultMessage: 'An error occurred',
70
- },
71
- });
72
- }
73
- // Unset loading state
74
- setIsSubmitting(false);
75
- unlockApp();
76
- };
77
-
78
- return (
79
- <Main>
80
- <SettingsPageTitle name="Roles" />
81
- <Formik
82
- enableReinitialize
83
- initialValues={{ name: '', description: '' }}
84
- onSubmit={handleCreateRoleSubmit}
85
- validationSchema={schema}
86
- >
87
- {({ handleSubmit, values, handleChange, errors }) => (
88
- <Form noValidate onSubmit={handleSubmit}>
89
- <HeaderLayout
90
- primaryAction={
91
- !isLoadingPlugins && (
92
- <Button type="submit" loading={isSubmitting} startIcon={<Check />}>
93
- {formatMessage({
94
- id: 'global.save',
95
- defaultMessage: 'Save',
96
- })}
97
- </Button>
98
- )
99
- }
100
- title={formatMessage({
101
- id: 'Settings.roles.create.title',
102
- defaultMessage: 'Create a role',
103
- })}
104
- subtitle={formatMessage({
105
- id: 'Settings.roles.create.description',
106
- defaultMessage: 'Define the rights given to the role',
107
- })}
108
- />
109
- <ContentLayout>
110
- <Flex direction="column" alignItems="stretch" gap={7}>
111
- <Box
112
- background="neutral0"
113
- hasRadius
114
- shadow="filterShadow"
115
- paddingTop={6}
116
- paddingBottom={6}
117
- paddingLeft={7}
118
- paddingRight={7}
119
- >
120
- <Flex direction="column" alignItems="stretch" gap={4}>
121
- <Typography variant="delta" as="h2">
122
- {formatMessage({
123
- id: getTrad('EditPage.form.roles'),
124
- defaultMessage: 'Role details',
125
- })}
126
- </Typography>
127
- <Grid gap={4}>
128
- <GridItem col={6}>
129
- <TextInput
130
- name="name"
131
- value={values.name || ''}
132
- onChange={handleChange}
133
- label={formatMessage({
134
- id: 'global.name',
135
- defaultMessage: 'Name',
136
- })}
137
- error={
138
- errors.name
139
- ? formatMessage({ id: errors.name, defaultMessage: 'Invalid value' })
140
- : null
141
- }
142
- />
143
- </GridItem>
144
- <GridItem col={6}>
145
- <Textarea
146
- name="description"
147
- value={values.description || ''}
148
- onChange={handleChange}
149
- label={formatMessage({
150
- id: 'global.description',
151
- defaultMessage: 'Description',
152
- })}
153
- error={
154
- errors.description
155
- ? formatMessage({
156
- id: errors.description,
157
- defaultMessage: 'Invalid value',
158
- })
159
- : null
160
- }
161
- />
162
- </GridItem>
163
- </Grid>
164
- </Flex>
165
- </Box>
166
- {!isLoadingPlugins && (
167
- <UsersPermissions
168
- ref={permissionsRef}
169
- permissions={permissions}
170
- routes={routes}
171
- />
172
- )}
173
- </Flex>
174
- </ContentLayout>
175
- </Form>
176
- )}
177
- </Formik>
178
- </Main>
179
- );
180
- };
181
-
182
- export default EditPage;
@@ -1,194 +0,0 @@
1
- import React, { useState, useRef } from 'react';
2
- import { Formik } from 'formik';
3
- import { useIntl } from 'react-intl';
4
- import { useRouteMatch } from 'react-router-dom';
5
- import {
6
- useFetchClient,
7
- useOverlayBlocker,
8
- SettingsPageTitle,
9
- LoadingIndicatorPage,
10
- Form,
11
- useNotification,
12
- Link,
13
- } from '@strapi/helper-plugin';
14
- import {
15
- ContentLayout,
16
- HeaderLayout,
17
- Main,
18
- Button,
19
- Flex,
20
- Box,
21
- TextInput,
22
- Textarea,
23
- Typography,
24
- GridItem,
25
- Grid,
26
- } from '@strapi/design-system';
27
- import { ArrowLeft, Check } from '@strapi/icons';
28
- import UsersPermissions from '../../../components/UsersPermissions';
29
- import getTrad from '../../../utils/getTrad';
30
- import pluginId from '../../../pluginId';
31
- import { usePlugins, useFetchRole } from '../../../hooks';
32
- import schema from './utils/schema';
33
-
34
- const EditPage = () => {
35
- const { formatMessage } = useIntl();
36
- const [isSubmitting, setIsSubmitting] = useState(false);
37
- const toggleNotification = useNotification();
38
- const { lockApp, unlockApp } = useOverlayBlocker();
39
- const {
40
- params: { id },
41
- } = useRouteMatch(`/settings/${pluginId}/roles/:id`);
42
- const { isLoading: isLoadingPlugins, routes } = usePlugins();
43
- const { role, onSubmitSucceeded, isLoading: isLoadingRole } = useFetchRole(id);
44
- const permissionsRef = useRef();
45
- const { put } = useFetchClient();
46
-
47
- const handleEditRoleSubmit = async (data) => {
48
- // Set loading state
49
- lockApp();
50
- setIsSubmitting(true);
51
- try {
52
- const permissions = permissionsRef.current.getPermissions();
53
- // Update role in Strapi
54
- await put(`/${pluginId}/roles/${id}`, { ...data, ...permissions, users: [] });
55
- // Notify success
56
- onSubmitSucceeded({ name: data.name, description: data.description });
57
- toggleNotification({
58
- type: 'success',
59
- message: {
60
- id: getTrad('Settings.roles.edited'),
61
- defaultMessage: 'Role edited',
62
- },
63
- });
64
- } catch (err) {
65
- console.error(err);
66
- toggleNotification({
67
- type: 'warning',
68
- message: {
69
- id: 'notification.error',
70
- defaultMessage: 'An error occurred',
71
- },
72
- });
73
- }
74
- // Unset loading state
75
- setIsSubmitting(false);
76
- unlockApp();
77
- };
78
-
79
- if (isLoadingRole) {
80
- return <LoadingIndicatorPage />;
81
- }
82
-
83
- return (
84
- <Main>
85
- <SettingsPageTitle name="Roles" />
86
- <Formik
87
- enableReinitialize
88
- initialValues={{ name: role.name, description: role.description }}
89
- onSubmit={handleEditRoleSubmit}
90
- validationSchema={schema}
91
- >
92
- {({ handleSubmit, values, handleChange, errors }) => (
93
- <Form noValidate onSubmit={handleSubmit}>
94
- <HeaderLayout
95
- primaryAction={
96
- !isLoadingPlugins && (
97
- <Button
98
- disabled={role.code === 'strapi-super-admin'}
99
- type="submit"
100
- loading={isSubmitting}
101
- startIcon={<Check />}
102
- >
103
- {formatMessage({
104
- id: 'global.save',
105
- defaultMessage: 'Save',
106
- })}
107
- </Button>
108
- )
109
- }
110
- title={role.name}
111
- subtitle={role.description}
112
- navigationAction={
113
- <Link startIcon={<ArrowLeft />} to="/settings/users-permissions/roles">
114
- {formatMessage({
115
- id: 'global.back',
116
- defaultMessage: 'Back',
117
- })}
118
- </Link>
119
- }
120
- />
121
- <ContentLayout>
122
- <Flex direction="column" alignItems="stretch" gap={7}>
123
- <Box
124
- background="neutral0"
125
- hasRadius
126
- shadow="filterShadow"
127
- paddingTop={6}
128
- paddingBottom={6}
129
- paddingLeft={7}
130
- paddingRight={7}
131
- >
132
- <Flex direction="column" alignItems="stretch" gap={4}>
133
- <Typography variant="delta" as="h2">
134
- {formatMessage({
135
- id: getTrad('EditPage.form.roles'),
136
- defaultMessage: 'Role details',
137
- })}
138
- </Typography>
139
- <Grid gap={4}>
140
- <GridItem col={6}>
141
- <TextInput
142
- name="name"
143
- value={values.name || ''}
144
- onChange={handleChange}
145
- label={formatMessage({
146
- id: 'global.name',
147
- defaultMessage: 'Name',
148
- })}
149
- error={
150
- errors.name
151
- ? formatMessage({ id: errors.name, defaultMessage: 'Invalid value' })
152
- : null
153
- }
154
- />
155
- </GridItem>
156
- <GridItem col={6}>
157
- <Textarea
158
- name="description"
159
- value={values.description || ''}
160
- onChange={handleChange}
161
- label={formatMessage({
162
- id: 'global.description',
163
- defaultMessage: 'Description',
164
- })}
165
- error={
166
- errors.description
167
- ? formatMessage({
168
- id: errors.description,
169
- defaultMessage: 'Invalid value',
170
- })
171
- : null
172
- }
173
- />
174
- </GridItem>
175
- </Grid>
176
- </Flex>
177
- </Box>
178
- {!isLoadingPlugins && (
179
- <UsersPermissions
180
- ref={permissionsRef}
181
- permissions={role.permissions}
182
- routes={routes}
183
- />
184
- )}
185
- </Flex>
186
- </ContentLayout>
187
- </Form>
188
- )}
189
- </Formik>
190
- </Main>
191
- );
192
- };
193
-
194
- export default EditPage;
@@ -1,9 +0,0 @@
1
- import * as yup from 'yup';
2
- import { translatedErrors } from '@strapi/helper-plugin';
3
-
4
- const schema = yup.object().shape({
5
- name: yup.string().required(translatedErrors.required),
6
- description: yup.string().required(translatedErrors.required),
7
- });
8
-
9
- export default schema;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { CheckPagePermissions } from '@strapi/helper-plugin';
3
- import pluginPermissions from '../../../permissions';
4
- import RolesCreatePage from '../CreatePage';
5
-
6
- const ProtectedRolesCreatePage = () => (
7
- <CheckPagePermissions permissions={pluginPermissions.createRole}>
8
- <RolesCreatePage />
9
- </CheckPagePermissions>
10
- );
11
-
12
- export default ProtectedRolesCreatePage;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { CheckPagePermissions } from '@strapi/helper-plugin';
3
- import pluginPermissions from '../../../permissions';
4
- import RolesEditPage from '../EditPage';
5
-
6
- const ProtectedRolesEditPage = () => (
7
- <CheckPagePermissions permissions={pluginPermissions.updateRole}>
8
- <RolesEditPage />
9
- </CheckPagePermissions>
10
- );
11
-
12
- export default ProtectedRolesEditPage;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { CheckPagePermissions } from '@strapi/helper-plugin';
3
- import pluginPermissions from '../../../permissions';
4
-
5
- import RolesListPage from '../ListPage';
6
-
7
- const ProtectedRolesListPage = () => {
8
- return (
9
- <CheckPagePermissions permissions={pluginPermissions.accessRoles}>
10
- <RolesListPage />
11
- </CheckPagePermissions>
12
- );
13
- };
14
-
15
- export default ProtectedRolesListPage;
@@ -1,5 +0,0 @@
1
- import pluginId from '../pluginId';
2
-
3
- const getRequestURL = (endPoint) => `/${pluginId}/${endPoint}`;
4
-
5
- export default getRequestURL;
package/strapi-admin.js DELETED
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = require('./admin/src').default;