spicedb
spicedb copied to clipboard
Add support for mixins/templates/inheritance in schema
Often several models share the same set of relations and permissions. It would be nice if Authzed schema supported some kind of way of deduplicating these definitions, and possibly also for re-using that mechanism to simplify type declarations:
example:
mixin crud {
relation editor: user
relation viewer: user
permission create = editor
permission read = editor + viewer
permission update = editor
permission delete = editor
}
definition book {
mixin crud
}
definition car {
mixin crud
}
definition movie {
mixin crud
}
and possibly:
definition anotherthing {
relation crudable: crud
}