From e5be086429ff468b6b1dcf64a79bf365da12c33a Mon Sep 17 00:00:00 2001 From: Convly Date: Fri, 28 Apr 2023 15:12:01 +0200 Subject: [PATCH] tmp - condition --- examples/getstarted/src/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/getstarted/src/index.js b/examples/getstarted/src/index.js index 5abfcc85cf..3df2386e35 100644 --- a/examples/getstarted/src/index.js +++ b/examples/getstarted/src/index.js @@ -7,7 +7,19 @@ module.exports = { * * This gives you an opportunity to extend code. */ - register({ strapi }) {}, + async register({ strapi }) { + await strapi.admin.services.permission.conditionProvider.register({ + displayName: 'Something', + name: 'is-something', + plugin: 'foo', + handler: (user) => ({ + // name: { $ne: 'MARC' }, + // addresses: { notrepeat_req: { name: 'toto' } }, + 'addresses.repeat_req': { $elemMatch: { name: 'toto' } }, + addresses: { $elemMatch: { postal_code: { $eq: '58' } } }, + }), + }); + }, /** * An asynchronous bootstrap function that runs before