Hello, I have a question regarding
# spicedb
m
Hello, I have a question regarding schema definitions and user defined roles, been reading the [article](https://authzed.com/blog/user-defined-roles) about user-defined roles, but I does not really fit my example as I want to have the predefined roles int the schema itself. I have a system that has users that belongs to orgs, apps that belongs to orgs and users can have roles over apps, viewer, editor admin. The available permissions for these predefined roles are. - admin: create/delete/view/edit - viewer: view - editor: view/edit. I would like to provide custom roles at the org level. I have came up [with a solution](https://play.authzed.com/s/6tI77U6bCyxb/schema) that I think works good, but given that I am pretty new to this, I am unsure whether I am doing something totally wrong What I do is I define orgs/app/users as definitions and also a new one called
custom_role
, where I define the organization relationship, and also 'self relationships' one per 'permissions' in apps. With this in-place I just need to add these custom_org permissions from orgs to the calculation of app permissions, is this correct?
y
nothing you're doing sticks out to me as wrong 🤷 if it satisfies your business logic this seems like a perfectly sane schema. is there something about it that feels wrong?
m
Is just that is a total different approach to the 'user-defined' roles article that is in the blog. I am learning now how things are done and am kind of paranoid in terms of performance or accidentially giving more permissions to what I expect
Thanks for the response either way, I will keep evolving my schema, many other use case are to be implemented. Thank you very much
y
sure thing!
and yeah this is something that we want to improve our documentation around - having more "recipes" and tips/guidance around schema building
13 Views