Permissions: Check for existing relation in a reference table for the given input ID #10026
Unanswered
felixhagspiel
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all!
I have a table
group
, a tablefriend
and a reference tablegroup_friend
, which just holdsgroupId
andfriendId
. The tablesgroup
andfriend
both have acreatorProfileId
that references to which user those two belong.Now I want a user to be able to only insert rows into the table
group_friend
if:group
friend
table that matches the users profile ID and the friends profile IDFor this I would like to use the values of the input variables (not the session variable) in my permission. Is this even possible? I have read through the FAQ but I only have found a way to reference the root table (
group_friend
).This is what I have so far:
Maybe I am overthinking this, but of course I do not want users to be able to add users to a group that does not belong to them or to add a user when they have no
friend
reference with each other. Is this permission setup possible with hasura or do I have to create an edge function for this logic?Beta Was this translation helpful? Give feedback.
All reactions