Want to prioritize this issue? Try:

What's your scenario? What do you want to achieve?
I have users, tenants, roles, objects and actions like this:
users:
tenants:
- tenant_1
- tenant_2
- ...
roles:
ordersManager (must have access to objects:actions like orders:(view|create|update|delete) in own tenant)
ordersAssistant (must have access to one object -> orders:view in own tenant
accountant (access to invoices:(view, create, update, delete) in own tenant
admin (access to all objects:actions in own tenant)
superadmin (access to all object:actions in any tenants)
How bindings will look like:
user_1 is ordersManager in tenant_1
user_2 is accountant in tenant_1
user_3 is admin in tenant_2
user_4 is superadmin
additionally, any explicit rule can be applied to any user/tenant like:
user_5 in tenant_1 has access to orders:list.
I tried to model policy for all this, but without any luck
p, superadmin, *, *, *
p, ordersAssistant, *, orders, list
g, user:1, ordersAssistant, tenant:1
#roles?
g, admin, superadmin
g, accountant, admin
g, ordersAssistant, admin
g, ordersManager, admin
g, ordersAssistant, ordersManager
but I don’t understand at all how to write all these roles, objects and actions in policy definition?
could someone help me?
Want to prioritize this issue? Try:
What's your scenario? What do you want to achieve?
I have
users,tenants,roles,objectsandactionslike this:users:
tenants:
roles:
ordersManager(must have access to objects:actions likeorders:(view|create|update|delete)in owntenant)ordersAssistant(must have access to one object ->orders:viewin owntenantaccountant(access toinvoices:(view, create, update, delete)in owntenantadmin(access to all objects:actions in owntenant)superadmin(access to all object:actions in any tenants)How bindings will look like:
user_1isordersManagerintenant_1user_2isaccountantintenant_1user_3isadminintenant_2user_4issuperadminadditionally, any explicit rule can be applied to any user/tenant like:
user_5intenant_1has access toorders:list.I tried to model policy for all this, but without any luck
but I don’t understand at all how to write all these
roles,objectsandactionsinpolicydefinition?could someone help me?