17 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
DMehaffy
154e59c9c7
Use the MongoDB setting useUnifiedTopology when testing connection (#9561)
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
2021-03-02 08:56:41 +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
c9c936ba41 Merge branch 'master' into feature/relational-fields
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-25 16:37:32 +01:00
DMehaffy
bac867c816
Add support for columnType in Mongoose (#8723)
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
2020-11-25 13:54:44 +01:00
Alexandre Bodin
8589848ce4 Merge branch 'features/draft-publish' into releases/3.2
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-01 16:23:32 +02:00
Igor Nikolenko
4700f79bcf
Fix validation of Date and Time field types for Mongoose connector (#7801)
Signed-off-by: richardgrey <richie.grey@gmail.com>
2020-09-29 14:53:56 +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
7a8c865051 Merge branch 'develop' into features/media-lib
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-03-02 15:18:08 +01:00
Alexandre Bodin
77b1a2944b Add mongoose uid type
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-02-13 16:46:37 +01:00
Alexandre Bodin
2886bb7acb Add manyWay lookup match expr and fix conversion of id and _id type for mongoose match 2020-01-07 12:51:21 +01:00
Alexandre Bodin
252941d589 Allow null value in mongo enums 2020-01-06 11:15:00 +01:00
Alexandre Bodin
c66fe82c41 Handle time and date in mongo 2019-12-05 15:26:01 +01:00
Alexandre Bodin
50e35f1026 Support updates 2019-11-26 11:24:00 +01:00
Alexandre Bodin
66b2d4f5c3 Init 2019-10-23 17:02:23 +02:00