Backend on Rocketgraph
Head over to the Hasura console. You can find it here on the 2nd tab in Rocketgraph:
use the password to login to the console. And head over to the data column and create the following columns:
Permissions
We have to add user permissions so that the users can view only their messages.
Head over to the permissions tab in messages and create a role called user. A user is a person's role who is logged in.
Create insert permissions as follows:
Notice the column presets. WE are letting Hasura to inject custom variables automatically into our columns, so we can use them later.
Next allow select over the messages as follows:
We are telling Hasura to only allow messages to the user if he is the sender or receiver of the message.
And save:
Top comments (0)