Greetings Strapi team,
To explore if role-based access control fits our need, we are on trail of enterprise edition v3.6.8.
Our team is trying to limit admin role access to certain projects. These projects are associated with companies (company has many projects). the end goal is that company admins can only see their projects.
I created a new role and a new condition called ‘is aaa project’ and selected it for read permission. It didn’t work as expected for that admin. it shows blank page with nothing under projects
Here is code in my ./config/functions/bootstrap.js
file
module.exports = () => {
const condition = {
displayName: "is aaa project",
name: "is-aaa-project",
handler: { company: { $eq: 1 }}, //handler1
handler: { 'company.id': { $eq: 1 }}, //handler2
handler: { 'company.id': 1}, //handler3
handler: { 'company.name': 'AAA'}, //handler4
handler: { 'company.name': { $eq: 'AAA' }}, //handler5
}
strapi.admin.services.permission.conditionProvider.register(condition);
};
I guess my question is what’s the key value that condition handler is searching for? In this case I assume it’s the project object which has company object. but none of the above attempts worked. I read the official blog here, couldn’t find anything helpful.
Thanks in advance.