System Information
- Strapi Version: 4.3.8:
- Operating System: Ubuntu:
- Database: MySQL:
- Node Version: 16.17.0:
- NPM Version: 8.15.0:
- Yarn Version: 1.22.18:
Here is the custom conditions explain how you can use them in enterprise edition.
Register custom conditions
There is no good example to understand how these work. For example I have collection type “wheat” where is one field name “price”. I want to show only those entries where price is greater than 50.
For this I’m using that condition.
const condition = {
displayName: 'price greater than 50',
name: 'price-gt-50',
async handler(user) {
return { price: { $gt: 50 } };
},
};
- Create new role (wheat_user) with read, write, update, delete and for read add price condition
- Added new user with “wheat_user” role
- Open wheat content-type
- it says “You don’t have the permissions to access that content”
What I’m doing wrong. could you please explain how these conditions work