Hi mates, trying to upload schema into
# spicedb
r
Hi mates, trying to upload schema into cloud spicedb through cli but have a problem with caveats
Copy code
1:04PM FTL failed to write schema error="rpc error: code = InvalidArgument desc = invalid allowed relation `smile2impress/employee with allowed_appointment_type`: the length of the unpacked is not equal to the provided input"
Copy code
definition smile2impress/employee {}

definition smile2impress/role {
  relation member: smile2impress/employee
}

definition smile2impress/application {
    relation user: smile2impress/role#member
    permission use = user
}

definition smile2impress/organization {
    // appoitments management
    relation appointment_creator: smile2impress/role#member

    relation blacklisted_on_appointment_creation: smile2impress/employee
    relation test: smile2impress/employee with allowed_appointment_type
}

caveat allowed_appointment_type(appointment_type string, allowed_appointment_types list<string>) {
    appointment_type in allowed_appointment_types
}
do you know what can be wrong ? in playground everything was working fine
v
can you check your permission system name has the same name as
smile2impress
?
r
hm, what do you mean
permission system
?
I imported this schema through development playground successfully
j
the caveat is missing the prefix
it needs to be named with
smile2impress/
as well
as does its reference
76 Views