11 Commits

Author SHA1 Message Date
Jean-Sébastien Herbaux
15c04d0612
Fix RBAC permissions without subject ignoring conditions (#10291)
* Fix RBAC permissions without subject ignoring conditions

* Add unit test for nil subject in the permission engine
2021-05-17 08:14:58 +02:00
Jean-Sébastien Herbaux
934a47eb34
Add possibility to set "required" RBAC conditions (#10185)
* Add optional property 'required' to rbac conditions

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

* Fix tests, remove object handler support & fix bug (pm.queryFrom)

* Remove required property, handle required conditions at the engine level (raw)

* Update EE snapshots

* Add hasSuperAdminRole util
2021-05-10 11:24:45 +02:00
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 Burgy
30ed3985c6
Replace John Doe by Kai Doe (#8738)
Signed-off-by: Pierre Burgy <pierre.burgy@gmail.com>
2020-12-14 16:57:18 +01:00
Convly
35cccd457f Add tests for strapi-admin/services (especially on /permissions/). Some bug fixes on the permissions-manager
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-17 12:01:16 +02:00
Convly
ed6a68d9be Add category to conditions
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 11:09:45 +02:00
Convly
027848eaa7 Fix pr comments (add doc, simplify engine code, add async test condition)
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 11:05:51 +02:00
Convly
a0b4132217 Merge engine.findPermissionsForUser with service.findUserPermissions
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 11:05:51 +02:00
Convly
bfb782069e Update permission-engine tests 2020-07-08 11:05:50 +02:00
Convly
efe6323eb3 Add checkMany & rework evaluatePermission (permission-engine) 2020-07-08 11:05:50 +02:00
Convly
f0b5f6a849 Add tests for the conditions provider & permissions engine 2020-07-08 11:05:49 +02:00