```definition user {} definition business { r...
# spicedb
s
Copy code
definition user {}

definition business {
    relation owner: user
    relation member: user
    relation book_keeper: user

    relation has_capital: business

    permission manage_business = owner
    permission access_capital = book_keeper + owner + has_capital
}

definition capital {
    relation business: business

    relation reader: user
    relation writer: user

    permission view = reader + writer + business->access_capital
    permission request = writer + business->owner + business->has_capital
    permission edit = request + business->owner + business->has_capital
    permission delete = business->owner + business->has_capital
}
Hi, am I on the right path and is the way im doing "correct" The goal is that we have certain businesses that have access to our "capital product." In our capital product, only the owner can
view
,
edit
,
request
, or
delete
, while the bookkeeper can only
view
. Also, I'm a big fan of the SpiceDB project!
2 Views