Custom RBAC on relation's dropdown field (content-manager)

How do you limit relation field content according to roles ?

image

I have workaround which deals with internal modification of /plugin-content-manager/server/controllers/relations.js By simply commenting the default filter field.

However, i am concerned with the comment which says “Cannot Filter for RBAC Reasons”
what is that suppose to mean ? Is it implying strapi already handles it ?

image

System Information
  • Strapi Version: v4.11.7
  • Operating System:
  • Database: Postgres
  • Node Version: 18
  • NPM Version:
  • Yarn Version:

Hi, I have a similar use case but instead of RBAC filters, I want to filter based on a type field of the relation’s ContentType. Which workaround did you use?

Thanks.

my common workflow:

  1. patch the node_modules/@strapi/admin (depends on your use case)

  2. for power modification code on src/index.js, modify any objects, ctx, or anything that somehow manipulates the flow of data, which resulted in specific output you want. You can even sniff what the relation input dropdown is doing in the index.js. Middleware would also work like charm for such case.

  3. other method is by making injectionZone that can be inserted into many places and watches it (i call it the react view watcher). This is very powerful if you can combine it with redux (basically you can change any state data in react component)