Rank 2: Process
any example you can refer
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
any example you can refer
Okay can you explain what you mean by conditionally setting document security?
If you're trying to restrict access based on the user, it's possible.
Have you looked at this by any chance?
https://appwrite.io/docs/permissions#example-1
Rank 2: Process
i am taking about attribute based conditin, not role boesd
Rank 2: Process
role based examples are there, what I can tell from doc
For example, if there is a user with name Safwan, email as safwan@example.com and user id as 7b9c24929ncnmc11, then you can use the Permission.role(Role.user('7b9c24929ncnmc11')) and only that user will be able to read the document
Attribute as in?
Rank 2: Process
i need something like in a documnet an attribute called let say isPublic which set to boolean, and based on that i will enable the access
so this isPublic attribute will be set for each document right?
Rank 2: Process
yup
and do you plan on setting this attribute manually from the dashboard, or through your client side code, when using createDocument?
Rank 2: Process
any way, I don;t think that matters here
Rank 2: Process
while reading the documnet i need to check if anyone try to access the documnet
Rank 2: Process
I can omit it using serverside code
It kind of does because if you're doing it through code, you can just create that document with Permission.read(Role.any())
Rank 2: Process
but I needed that to work on client, otherwise what; the use here using it , right
I don't see why you need an attribute to do this? Even if you were to use an attribute, you'll have to fetch the document, see if it's isPublic is set to false or true, and based on that move forward. This isn't good practice I believe.
Rank 2: Process
but that's is role based, that's what I was trying to say
This will work on client.
Rank 2: Process
I don;t think, is required, supabase is providing that
Yes but the role is user. So every user will have to satisfy the condition.
Rank 2: Process
Sometime we need, is useful creating internal role based access in project
Can I ask where this is explained in Supabase? I wanna make sure I understand what's happening
I'm sorry I don't quite undersatnd what you meant