https://authzed.com logo
Is there anyway to request the list of permissions that a subject has? ``` definition user {} definition document { relation writer: user relation reader: user /** * edit determines whether a user can edit the document */ permission edit = writer /** * view determines whether a user can view the document */ permission view = reader + writer } ``` For example, using the above schema, I'd want to be able to do query for information like the following: `user:id [document.edit, document.view]`. I'm intending to use this information to control component visibility. Any thoughts or suggestions of other directions to go in?
l

lemonsrc

03/30/2023, 6:17 PM
Is there anyway to request the list of permissions that a subject has?
definition user {}

definition document {
    relation writer: user
    relation reader: user

    /**
     * edit determines whether a user can edit the document
     */
    permission edit = writer

    /**
     * view determines whether a user can view the document
     */
    permission view = reader + writer
}
For example, using the above schema, I'd want to be able to do query for information like the following:
user:id [document.edit, document.view]
. I'm intending to use this information to control component visibility. Any thoughts or suggestions of other directions to go in?