https://cerbos.dev logo
#community
Title
# community
j

Jesum Yip

08/10/2023, 8:03 AM
has any one done any kind of integration between a crm system and cerbos policies? a business user modifies a customer's subscription in the crm system and the end result is cerbos policies get updated to reflect that.
f

Farzad Soltani

08/10/2023, 12:56 PM
Do you have any questions regarding the integration between your CRM and Cerbos? The case you mentioned seems to be quite achievable through Cerbos APIs. We have an admin API that does quite the same.
a

Aram Andreasyan

08/10/2023, 1:10 PM
Hey @Jesum Yip, As @Farzad Soltani mentioned (nicely spotted btw), this is possible through using the admin api. https://docs.cerbos.dev/cerbos/latest/api/admin_api Feel free to browse the api docs, specifically the following that you can utilize: https://docs.cerbos.dev/cerbos/latest/api/admin_api#_addupdate_policies to add/update the policies.
j

Jesum Yip

08/10/2023, 1:11 PM
the case is simple - what if a business user wants to set a customer's subscription to expire on the 15th of April 2029? Or allow a specific role from the customer access to resource-A, resource-B, and resource-C?
i guess i have to write a middleware that translates the business user's interaction into admin api calls
f

Farzad Soltani

08/10/2023, 1:11 PM
Yes, exactly. The middleware should transform your business logic to Cerbos API calls.
j

Jesum Yip

08/10/2023, 1:11 PM
i would also like to have a base set of permissions for reosurce-X which the middleware will maintain then more esoteric ones managed by hand
is it possible to split it into 2 separate yamls?
f

Farzad Soltani

08/10/2023, 1:12 PM
Yes, you can use derived roles to achieve this.
j

Jesum Yip

08/10/2023, 1:12 PM
i'll take a look. thanks!
This is the beauty of Cerbos in my opinion. It's not opinionated and it has no room for business logic. It does what it's supposed to do in the best and most efficient way possible.
j

Jesum Yip

08/10/2023, 1:13 PM
but every resource yaml lokos like this: apiVersion: api.cerbos.dev/v1 resourcePolicy: resource: myresourcename
can i have 2 yamls with the same resourcePolicy.resource value?
just exploring ideas
f

Farzad Soltani

08/10/2023, 1:15 PM
I haven't done this yet as I'm a beginner just like you. But I don't think there's anything blocking you to do so.
j

Jesum Yip

08/10/2023, 1:15 PM
okay will run some experiments
f

Farzad Soltani

08/10/2023, 1:16 PM
Share your results if you like. I'm interested in the things you might come across as your requirements are already more complex than mine.
4 Views