25 Commits

Author SHA1 Message Date
Jean-Sébastien Herbaux
1e5b1c99f6
I18n/ permissions rework (#9535)
* Add a domain layer for the permission, rework the engine handling of the permissions

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Add permissions-fields-to-properties migration for the admin

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Removes useless console.log

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove debug logLevel from provider-login.test.e2e.js

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Adds the new layout for the GET permissions, allow to subscribe to actionRegistered events, adds i18n handlers

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix typo

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update permissions validators

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update unit tests

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update integrations test + fix some validation issues

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Change plugins & settings section format for the permissions layout

* only return locales property to localized subjects for the permission's layout

* Do not send the locales property to the permission's layout when there is no locales created

* Add the 'locales' property to publish & delete routes

* Fix unwanted mutation of the sections builder states on multiple builds

* Fix units tests with (new engine)

* Fix admin-role e2e test - Add locales property to the update payload

* fix e2e testsé

* Update e2e snapshots

* Fix unit test for i18n bootstrap

* Add mocks for i18n/bootstrap test

* Fix has-locale condition & updatePermission validator

* Avoid mutation in migration, always authorize super admin for has-locales condition

* Rework rbac domain objects, add a hook module and a provider factory

* Remove old providers

* Update the admin services & tests for the new rbac domain & providers

* Fix tests, bootstrap functions & services following rbac domain rework

* Update migration runner

* PR comments

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove useless console.log

* Fix sanitizeCondition bug

* Section builder rework

* Add test for the section-builder section & add jsdoc for the permission domain

* pr comments (without the migrations)

* fix fields-to-properties migration

* Add jsdoc for the sections-builder

* Moves createBoundAbstractDomain from permission domain to the engine service

* Remove debug logLevel for admin role test (e2e)

* Fix core-store

* Fix hooks & move business logic from i18n bootstrap to dedicated services

* add route get-non-localized-fields

* use write and read permission

* refacto

* add input validator

* add route doc

* handle ST

Co-authored-by: Pierre Noël <petersg83@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-03-25 14:59:44 +01:00
Pierre Noël
b3a9b5ad76 add pluginOptions 2021-02-10 14:29:54 +01:00
Pierre Noël
ce3482025a add preferedLanguage 2021-02-08 15:03:12 +01:00
Convly
31d748f52e Add private to User.settings::blocked
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 11:48:45 +02:00
Alexandre Bodin
4edad86029 Add basic created_by updated_by
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 11:48:16 +02:00
Pierre Noël
9267674a15 prepare code for migration
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 11:48:14 +02:00
Pierre Noël
6a1d65bc37 third refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 11:09:52 +02:00
Pierre Noël
711c58b05e create role at startup + warning
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 11:09:49 +02:00
Convly
d69101427f Fix PR: Refactor user e2e tests, fix domain logic, add user::deleteOne route 2020-07-08 11:04:22 +02:00
Pierre Noël
970a470034 add tests + make role decription optional + refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 10:59:34 +02:00
Pierre Noël
182ec648d5 add loading of ee files + add create role
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 10:56:55 +02:00
Convly
9d9da4f467 add admin::permission model and setup its relation w/ the role model 2020-07-08 10:51:52 +02:00
Pierre Noël
1c65d3c10a add GET /roles/:id
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 10:46:11 +02:00
Convly
12953bd6f5 Add new POST /admin/users route (controller + related services). Update User model: remove required constraint on password field.
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:37:16 +02:00
Convly
8a69d187d0 Update models attributes & get models from the database manager
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:21:24 +02:00
Convly
f10f51f372 Add unique constraint for admin::role::name
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:21:22 +02:00
Convly
005df139c8 Remove minLength from firstname, lastname & username on admin::User
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:21:20 +02:00
Convly
45638dd97b Rename admin::administrator model to admin::user & add strapi_role model
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:21:14 +02:00
Alexandre Bodin
c364fcd0e2 Move lifecycles to sub field and added documentation
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-05-04 10:55:08 +02:00
Jean-Sébastien Herbaux
a583d1b859
Fix/#3184/fix server crashs on database change (#5703)
* Don't set connection field on create/edit operation on content-types & components

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Make sure that every component has a valid connection attribute

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove connection check on components load

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove default connections from core & webhook stores but make sure it's defined in the application lifecycle

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix component's associations that can be undefined instead of empty in populateBareAssociations

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove "default" connection from plugins' models

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove connection attribute from generated models (cli)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Mutate each component instead of reassign

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Build core_store and webhook model based on the current config

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Add connection to templates conditionally (based on args)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Set default value for description to undefined instead of empty string

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove unnecessary complexity

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update getStarted models

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix attributes parsing for generate:model

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Removed tpl option from generate:model/api

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove tpl option from cli

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-04-07 16:31:44 +02:00
Alexandre Bodin
6aab5568f8 Fix ctm hidden fields 2019-12-17 12:33:56 +01:00
Alexandre Bodin
06a419a295 Removes resetToken from administrator edit view 2019-09-03 09:56:16 +02:00
Alexandre Bodin
42e0bf8fed Refactor strapi-admin services and controllers 2019-05-24 17:03:01 +02:00
soupette
1544cdf877 Fix PR feedback 2019-04-09 18:35:49 +02:00
soupette
e56e46e030 Split admin and users.
Co-authored-by: lauriejim
2019-04-09 12:09:03 +02:00