304 Commits

Author SHA1 Message Date
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
Tom Dyson
5f08fa37e7
Fix typo in query error message (#10116)
The possessive `its` doesn't have an apostrophe.

https://www.dictionary.com/e/its-vs-its/
2021-04-26 17:08:09 +02:00
Alexandre BODIN
d67c749f34
Merge pull request #9994 from strapi/i18n/graphql
I18n/graphql
2021-04-09 15:40:55 +02:00
Alexandre Bodin
c7d67c53ed Add tests & handle _or & _where 2021-04-08 14:47:05 +02:00
Alexandre Bodin
c572b94349 Support extra _ root params 2021-04-08 14:13:39 +02:00
Alexandre Bodin
118d81bec8 Merge branch 'master' into features/i18n 2021-04-07 13:39:28 +02:00
Mattias van den Belt
e65ad58d2c
Fix undefined filter value error (#8490) (#9603) 2021-04-07 13:37:42 +02:00
Alexandre BODIN
2b915bc44f
Update content-types.js 2021-04-06 16:54:59 +02:00
Alexandre Bodin
f2cddb4c15 UID is always localized in i18n 2021-04-06 11:23:43 +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
Alexandre Bodin
17b2296d11 Init core api extension for i18n 2021-03-16 15:35:30 +01:00
Alexandre Bodin
2467cad937 Merge branch 'i18n/localizations-sync' into features/i18n 2021-03-16 10:01:25 +01:00
Alexandre Bodin
90deea4d67 Change field name 2021-03-12 17:52:28 +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
2ea169cbee Do not count localizations in CM 2021-03-11 10:27:48 +01:00
Alexandre Bodin
298a954888 Use non writables instead of static creator fields in fields logic 2021-03-09 20:50:23 +01:00
DMehaffy
ba0637e26b
Update all documentation links in the code-base and readmes (#9643)
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
2021-03-09 09:13:15 +01:00
Alexandre Bodin
996341f5d5 Move to many way & add populate option on assoc 2021-03-05 15:44:23 +01:00
Alexandre Bodin
469991f9f2 Merge branch 'master' into features/i18n 2021-02-18 14:36:32 +01:00
Alexandre BODIN
adf05599a5
Fix sanitize polumorphic entites that can be undefiend or ids only (#9441) 2021-02-18 11:20:32 +01:00
Alexandre Bodin
6f4655a266 Add tests & refactor into services 2021-02-15 11:24:28 +01:00
Alexandre Bodin
68f3e2bee2 Init i18n fields 2021-02-11 16:48:01 +01:00
Pierre Noël
b3a9b5ad76 add pluginOptions 2021-02-10 14:29:54 +01:00
Alexandre BODIN
8d342d33b7
Fix sanitize removing polymorphic relations (#9310) 2021-02-03 19:28:11 +01:00
Mattias van den Belt
23ead26f94
Fix undefined filter value (#8490)
* Fix undefined filter value

Fixes #8201

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>

* Move isNil() before .map() & update error message

Fixes #8201

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>

* Fix allowing to find null values

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>

Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-02-01 16:18:17 +01:00
Pierre Noël
291aeb07bc add read/create/update route for locales 2021-01-29 10:12:34 +01:00
Pierre Noël
08f9b05d21
Fix query when filtering and sorting on a relational field (#9045)
* fix query when filtering and sorting on a relational field

* add tests + refacto

* remove useless code
2021-01-11 17:21:01 +01:00
Christian Sandven
e825232dd5
check that model and model.privateAttributes is not undefined (#8669)
Signed-off-by: csandven <christian@recheckit.com>

Co-authored-by: csandven <christian@recheckit.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-01-11 16:53:13 +01:00
Pierre Noël
355888a5e7 add unit test for getRelationalFields 2020-12-18 17:53:52 +01:00
Pierre Noël
23dcde6d90 add didConfigureListView 2020-12-18 16:19:39 +01:00
DMehaffy
aad1c2fa03
Cleaning up codebase for doc repo move (#8892)
* [WIP] Cleaning up codebase for doc repo move

WIP

* Fix deleted files, add links to doc repo issues

* Add repo note to readme
2020-12-18 15:50:37 +01:00
Pierre Noël
885dc5a138 refacto findWithRelationCounts 2020-12-16 17:44:43 +01:00
Alexandre Bodin
e630cee0c9 Small refactoring to make the code easier to read 2020-12-10 11:17:41 +01:00
Convly
a415638848 mongoose:buildQuery : add the sort operator after the query matches, handle id=>_id, optimize the reorder by ids 2020-12-10 10:02:29 +01:00
Convly
92451db825 Add deep sort to mongoose, fix sort order on both connectors, cleanup
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-12-08 16:56:21 +01:00
soupette
61a3740c06 Fix conflicts
Signed-off-by: soupette <cyril.lpz@gmail.com>
2020-11-23 14:43:07 +01:00
Pierre Noël
59ac2dd6f4 add use of STRAPI_DISABLE_UPDATE_NOTIFICATION
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-11-09 17:01:16 +01:00
Pierre Noël
60bf24ce8b
Fix query when populating morph relations (#8548)
* change query when populating morph relations

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-11-06 14:35:36 +01:00
Alexandre Bodin
50a68e9f45 In sanitize input leave input data as is if model is not found
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-03 17:19:43 +01:00
Alexandre Bodin
7f906d7cf2 Refactoring
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:50:55 +01:00
Alexandre Bodin
0db015e6c2 Update tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:45 +01:00
Alexandre Bodin
07e7cfc0bd Make lint stricter and fix the errors
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:42 +01:00
Alexandre Bodin
8ecc36cfa3 Init refactoring of content manager configuration routes
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:42 +01:00
Diogo Correia
e797c5cf4c
Add clearer error messages on relation building (#8124)
* Add clearer error messages on relation building

Signed-off-by: Diogo Correia <me@diogotc.com>

* Add missing custom exceptions on relation building

Signed-off-by: Diogo Correia <me@diogotc.com>

* Fix spacing in relation building error messages

Signed-off-by: Diogo Correia <me@diogotc.com>

Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>
Co-authored-by: Pierre Noël <petersg83@users.noreply.github.com>
2020-10-22 18:27:40 +02:00
Thomas
2f97ff1f93
better error handling for missing model error (#8328)
* Ammending commit

Signed-off-by: Thomas Chezieres <tchezieres@MacBook-Pro.lan>

* ammending last commit

Signed-off-by: Thomas Chezieres <tchezieres@MacBook-Pro.lan>

Co-authored-by: Thomas Chezieres <tchezieres@MacBook-Pro.lan>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2020-10-15 16:39:46 +02:00
Alexandre BODIN
e53b54c218
Support query operators _or & _where in graphql with deep nesting (#8332)
* SUpport query operators _or _where in graphql with deep nesting

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

* Add testing for complexe graphql queries

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-15 13:22:40 +02:00
jiv_e
6fb0a63751
Refactor log level configuration (#7695)
* Refactor log level configuration

- Remove STRAPI_LOG_LEVEL environment variable related redundant code.
- Add helpful error message to the current log level configuration
  system.

Signed-off-by: Juho Viitasalo <juho.viitasalo@lildrop.com>

* Fix error message

Signed-off-by: Juho Viitasalo <juho.viitasalo@lildrop.com>

* Fix log level base value

* Fix breaking change

* Add debug message

* Change logger code to use Pino's log level values directly

* Update index.js

Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2020-10-08 18:58:59 +02:00
Alexandre Bodin
29286c8fdb Use non visible attributes as a reference for rbac fields
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-05 16:30:48 +02:00
Alexandre Bodin
c60f826f4e Fix unit test
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-05 14:24:41 +02:00