https://authzed.com logo
#spicedb
Title
# spicedb
y

Yansong

11/24/2022, 3:34 AM
hi guys sorry to disturb you. i have one trouble during use spiceDB. i will very appreciate it if anyone can help on it. my question is how can i specify explict role for user, and make objects available for the role? for example, there are several role: 1. dev 2. project_manager 3. admin dev can see the codebase, project_manager can see the schedule and admin can see both. how shuold i draft it as zed schema? is this true?
Copy code
definition user {}

definition role {
    relation project_manager: user
    relation dev: user
    relation admin: user
}

definition codebase {
    relation member: role#dev | role#admin

    permission view = member
}

definition schedule {
    relation member: role#project_manager | role#admin

    permission view = member
}
it looks weird...