Rinat Sharipov
06/13/2024, 6:30 PMuser should have access to create an appointment only in city that he has access to, some users can have access to all cities
example:
definition smile2impress/employee {}
definition smile2impress/role {
relation member: smile2impress/employee
}
definition smile2impress/organization {
// appoitments management
relation appointment_creator: smile2impress/role#member
permission create_appointment = appointment_creator
// locations management
relation all_cities_accessor: smile2impress/employee
permission access_all_cities = all_cities_accessor
}
definition smile2impress/city {
relation organization: smile2impress/organization
relation employee: smile2impress/employee
permission access = employee + organization->all_cities_accessor
}
with this schema
- I can check whether employee role allows to make an appointment
- I can check whether employee has access to city
how to combine this two checks into one inside of caveat ? or I should do it somehow differently