Caveats | SpiceDB and AuthZed Documentat...
# spicedb
Hello, I was wondering if you could help me with a question about caveats in Authzed. I'm having the following caveat: caveat can_create_campaign_type(allowed_campaign_types list, campaign_type string) { // allowed_campaign_types.contains(campaign_type ) } What I'm trying to do is to check if the allowed_campaign_types contain campaign_type. I've seen here: that list should be a valid type, but I'm wondering where I can find the available functions that I can use on a list. Thanks
👋 SpiceDB Caveats are defined as CEL expressions. The language definition can be found here: in particular, you should be able to write the expression as:
Copy code
caveat can_create_campaign_type(allowed_campaign_types list<string>, campaign_type string) {
  campaign_type in allowed_campaign_types
Ah, perfect. That's exactly what I was looking for, thanks 🙂