System Information
- Strapi Version: 3.6.5 (Enterprise)
- Operating System: strapi/strapi Docker Image
- Database: MySQL
- Node Version: 12.20.1
- NPM Version:
- Yarn Version:
Hi!
I want to make certain content within the Strapi admin only accessible to certain Roles.
At the moment, there are 2 entities in our strapi: “brand” (which is basically our business partners) and “page”. Each page is linked to exactly one brand and one brand can have many pages.
Now, according to Configurations - Strapi Developer Documentation , I have created a new condition in the config/function/bootstrap.js file:
module.exports = () => {
strapi.admin.services.permission.conditionProvider.register({
displayName: 'Belongs to brand Nomos',
name: 'belongs-to-brand-nomos',
plugin: 'admin',
handler: user => ({ 'brand.elibBrand': 'nomos' }),
});
};
This (almost) works as intended, but only for the “page” entities. Here i only see the pages associated to the “nomos” brand.
But when i navigate to the “brands” overview, Strapi shows me an error (because a brand does not have the attributes brand.elibBrand but only elibBrand).
How can i accomplish this to work for the brand entity as well?
And further: even in a “page” entry, i can still set the brand relation to any other brand (see screenshot). Is there any way to change this?