22 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
3e1a823f1b add migration when a CT becomes localized 2021-03-24 12:14:49 +01:00
Alexandre Bodin
996341f5d5 Move to many way & add populate option on assoc 2021-03-05 15:44:23 +01:00
Jozef Cipa
808b2a464f
Handle duplicate entry error (#8367)
* Handle duplicate entry error message in bookshelf connector

Signed-off-by: jozefcipa <jozef.cipa@strv.com>

* Handle duplicate error message in mongoose connector

Signed-off-by: jozefcipa <jozef.cipa@strv.com>

* Apply changes from review

* Fix wrapping transactions in bookshelf adapter

* Add missing await to wrapErrors

* Call findOne without this
2021-01-25 14:03:48 +01:00
Alexandre BODIN
81c684d7b4
Merge pull request #8314 from strapi/fix/dpMigration
fix d&p regressions
2020-10-20 14:08:49 +02:00
Convly
03f5342123 Fix deepFiltering with draft & publish
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-10-19 15:39:56 +02:00
Pierre Noël
d84284faf2 refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-10-16 18:54:10 +02:00
Pierre Noël
e2341e9b06 run creation/update of the database even if the model hasnt changed
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-10-16 18:54:10 +02:00
Pierre Noël
025eed964c dont run d&p migration at CT creation + rebuild tables if there were deleted in DB
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-10-16 18:54:09 +02:00
Alexandre BODIN
e87af3f6c6
do not set id to undefined (#8232)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-07 23:11:00 +02:00
Jean-Sébastien Herbaux
e7861232d0
Fix wrong query generation with bookshelf (#8228)
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-10-07 23:10:38 +02:00
Alexandre Bodin
5f7fcafc5f Fix publciationState for nested populations
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-06 10:08:30 +02:00
Jean-Sébastien Herbaux
c4716d5668 [D&P] Return published content by default from get apis (#7657)
* Add _publicationState request param / Returns live by default for CT that have D&P activated

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-09-22 17:39:46 +02:00
Pierre Noël
74a85c1127 Add migration d&p 2020-09-22 17:39:40 +02:00
Alexandre Bodin
7c8d51d15d fix 204 issues and use strapi.db.getModelByAssoc
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 10:59:38 +02:00
Alexandre Bodin
ba8509eac8 Apply PR feedbacks
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 10:59:38 +02:00
Alexandre Bodin
c6e08dcb57 Add assign permission
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 10:59:37 +02:00
Alexandre Bodin
2fa574b061 Fix isComponent on null attributes 2019-12-09 14:01:11 +01:00
Alexandre Bodin
a5288f0cf7 Implement new populate algorithm loading nested components and dynamic zones 2019-11-13 18:49:05 +01:00
Alexandre Bodin
80fb99f38e Refactor populateFetch in its own module 2019-11-13 18:49:04 +01:00
Alexandre Bodin
79d1207c0c Create dynamiczone in queries 2019-11-13 18:49:02 +01:00
Alexandre Bodin
66b2d4f5c3 Init 2019-10-23 17:02:23 +02:00