284 Commits

Author SHA1 Message Date
Alexandre Bodin
43b947b2ba v3.6.2 2021-05-11 11:43:35 +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
Alexandre Bodin
2fd29041f8 v3.6.1 2021-04-29 14:34:38 +02:00
Alexandre Bodin
4ab210eec6 v3.6.0 2021-04-21 17:00:57 +02:00
Alexandre Bodin
614ce35d37 Merge branch 'master' into features/i18n 2021-04-09 17:43:59 +02:00
Pierre Noël
c086bcc9d7 handle compo, dz and media migration when disabling i18n on a field 2021-04-08 19:04:00 +02:00
dependabot[bot]
ca237cffdf
Bump lodash from 4.17.20 to 4.17.21 (#9990)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 14:06:59 +02:00
Alexandre Bodin
118d81bec8 Merge branch 'master' into features/i18n 2021-04-07 13:39:28 +02:00
jonmol
3b728c295b
Remove some of the unnecessary distinct (#9538)
* Only add distinct if it's a join

* made both if the same

* moved repeated if to variable

* forgot an import

* too quick doing this between meetings...

* Renamed boolean constants and changed the the distinct logic, instead of being twice it's only needed to have once

* fixed if
2021-04-06 09:34:30 +02:00
Alexandre Bodin
fd18d2a67a Merge branch 'master' into features/i18n 2021-04-02 17:33:24 +02:00
Pierre Noël
3c85f38fb4 Delete all entries in a locale when locale is deleted 2021-04-01 15:40:51 +02:00
Pierre Noël
740f22762e
fix error wording when join table name is too long (#9880) 2021-03-30 12:34:50 +02:00
Pierre Noël
2149493137 add migration when i18n is disabled on a CT 2021-03-29 16:28:01 +02:00
Alexandre Bodin
a66e0269da Merge branch 'master' into features/i18n 2021-03-25 15:07:41 +01: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
Alexandre Bodin
3065d72a4b v3.5.4 2021-03-25 14:34:45 +01:00
Pierre Noël
3e1a823f1b add migration when a CT becomes localized 2021-03-24 12:14:49 +01:00
Pierre Noël
ec0aca2de8 add migration for SQL DBs 2021-03-18 18:43:36 +01:00
Pierre Noël
9950bbe4c0 add previousDefinition in migration options 2021-03-18 18:28:19 +01:00
Alexandre Bodin
2467cad937 Merge branch 'i18n/localizations-sync' into features/i18n 2021-03-16 10:01:25 +01:00
Alexandre Bodin
c40c3ba8c3 pick assoc populate fields option 2021-03-12 17:56:38 +01:00
Alexandre Bodin
4583e3d086 Split logic cleanly between visible & writable attributes 2021-03-12 14:34:04 +01:00
Alexandre Bodin
c57b3be1eb Merge branch 'master' into features/i18n 2021-03-12 09:45:51 +01:00
Alexandre Bodin
33552e43b8 v3.5.3 2021-03-11 14:25:37 +01:00
germangonzo
a40e3b0014
Fix error with polymorphic relations when the attribute name is different to related (#9396) 2021-03-11 14:11:23 +01:00
dependabot[bot]
fcc409de7c
Bump date-fns from 2.16.1 to 2.19.0 (#9666)
Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.16.1 to 2.19.0.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md)
- [Commits](https://github.com/date-fns/date-fns/compare/v2.16.1...v2.19.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-03-10 12:01:06 +01:00
Alexandre Bodin
996341f5d5 Move to many way & add populate option on assoc 2021-03-05 15:44:23 +01:00
Alexandre Bodin
e9b4bf5616 Merge branch 'master' into features/i18n 2021-03-05 12:22:18 +01:00
Alexandre Bodin
1a472c98a7 v3.5.2 2021-03-01 11:24:44 +01:00
Pierre Noël
e436a34d46
fix knex, pg, mysql versions (#9511) 2021-02-24 21:59:18 +01:00
Convly
3cc49c4ea8 v3.5.1 2021-02-23 11:23:21 +01:00
Alexandre Bodin
469991f9f2 Merge branch 'master' into features/i18n 2021-02-18 14:36:32 +01:00
Alexandre Bodin
d02a7ba2fa v3.5.0 2021-02-18 11:28:28 +01:00
jonmol
7a6432da73
added a way to have a less expensive search (#9316)
* added a way to have a less expensive search

* renamed skipSearch to searchable

* forgot to remove one skipSearch

* skip non searchable fields on mongoose query

* cleaned up the if statement

* reverted change to strapi-plugin-upload/models

Co-authored-by: Luis del Rio <ldelriof@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-02-16 17:37:30 +01:00
Alexandre Bodin
cefdde18f4 Init db lifecycles manager 2021-02-16 16:48:16 +01:00
Alexandre BODIN
6dd67d5c76
Fix pool config (#9417) 2021-02-16 10:16:49 +01:00
Alexandre Bodin
be1b8f20e8 Cleanup to be mergeable now 2021-02-15 11:32:37 +01:00
Alexandre Bodin
02782076d0 Update migrations to be more extensible 2021-02-15 08:45:20 +01:00
Alexandre Bodin
1592417ed3 Add migration manager in database 2021-02-12 12:52:29 +01:00
Pierre Noël
2ed1c05302
fix pool options (#9348) 2021-02-08 17:59:36 +01:00
Alexandre Bodin
544f98b8ee v3.4.6 2021-02-03 19:32:36 +01:00
Jorrit Schippers
175422d760
Update .npmignore files (#8865)
Add .editorconfig, .snyk, __tests__, jest.config.js
Remove .npmignore and .gitignore from admin subdirectories

Signed-off-by: Jorrit Schippers <jorrit@ncode.nl>
2021-01-28 16:57:29 +01:00
Jorrit Schippers
3f63902d4b
Use https:// in package.json and README.md files (#9227)
Signed-off-by: Jorrit Schippers <jorrit@ncode.nl>
2021-01-26 17:06:25 +01:00
Alexandre Bodin
4f9cc8a22c v3.4.5 2021-01-26 11:59:47 +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
Jozef Cipa
a48f9f3327
Fix lower() error when running on non-string column (#8419)
Signed-off-by: jozefcipa <jozef.cipa@strv.com>
2021-01-21 11:36:17 +01:00
Alexandre Bodin
542786f263 v3.4.4 2021-01-20 17:31:59 +01:00
Anthony Nguyen
b4f75fd7a6
Add min:0 to templates of Bookshelf DBs. Issue #8436 (#9155)
* Add min:0 to templates of Bookshelf DBs. Issue #8436

* Moving default property from db template to knex.js

* Move min to pool
2021-01-18 14:14:39 +01:00
Alexandre Bodin
553d64cafd v3.4.3 2021-01-14 10:46:50 +01:00
Pierre Noël
70ffd7c65b
Fix CM limited to show only 100 entries (#9118)
* fix mongo count

* harmonize code between mongoose and bookshelf

* refacto
2021-01-13 20:15:45 +01:00