Hello all! I'm doing a POC with spicedb to try and...
# spicedb
w
Hello all! I'm doing a POC with spicedb to try and replace our handmade permission service, but I'm having lots of trouble wrapping my head around the schema language. I'm trying to implement a permission which seems pretty basic to me:
Copy code
definition user {}

/* feature flags can be enabled per organisation */
definition flag {}

/* we have multiple organisations in our system */
definition organization {
    /* each organisation has multiple users */
    relation member: user
    /* each organisation has multiple admins */
    relation admin: user
    /* this represents whether this org has the new_admin_dashboard
     * feature flag enabled */
    relation flag_new_admin_dashboard: flag

    /* to access the new admin dashboard, the user needs to be an admin and
     * the org needs to have the new_admin_dashboard feature flag enabled */
    permission view_new_admin_dashboard = admin & flag_new_admin_dashboard // doesn't work :(
}
I just can't seem to figure out how to implement this
view_new_admin_dashboard
permission! I've been reading the docs for hours but I'm probably still missing the correct mental model, could you help me out?