Hi everyone, is it possible to have multiple cavea...
# spicedb
s
Hi everyone, is it possible to have multiple caveats on a relation? I want to make the escalate permission only allowed for
owner
with active org_unit and resolved ticket. I don't want to merge the
ticket_is_resolved
and
org_unit_is_active
caveats into one caveat, because i want to use it in multiple definition
Copy code
caveat ticket_is_resolved(ticket_status string) {
    ticket_status == "resolved"
}

caveat org_unit_is_active(org_status string) {
    org_status == "active"
}

definition user/human {}

definition resource/ticket {
    relation owner: user/human with ticket_is_resolved | user/human with org_unit_is_active

    permission escalate = owner
}
Copy code
resource/ticket:ticket_id#owner@user/human:user_id[ticket_is_resolved, org_unit_is_active]