tmp - condition

This commit is contained in:
Convly 2023-04-28 15:12:01 +02:00
parent db90d338a5
commit e5be086429

View File

@ -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