Rank 3: Container
Does the sdk provide any method to format permissions?
the permissions return object shows them currently as complete strings, if not whats a good alternative for now?
Votes
2
Replies
9
Participants
Unknown
Messages
10
Rank 3: Container
Does the sdk provide any method to format permissions?
the permissions return object shows them currently as complete strings, if not whats a good alternative for now?
We don't have a good solution for this, beside parsing them unless @Meldiron or @Steven have some ideas.
Anyways, this is something we really want to improve, how would you expect the SDK to handle this? Would some extra methods help? which?
Hey 👋 I cant think of any simple way from top of my head.
Extra question, what is your use case - why do you need to parse them? Ideally you should not be required to work with those.
Rank 3: Container
im thinking of using regex expressions but thinking further they dont come in expected orders
Rank 3: Container
i want to show ui content for perms + roles
That sounds reasonable. Well this is the structure:
TYPE("ROLE")
Where TYPE can be read,write,create,update,delete and role can be:
anyguestsusers or users/USER_ID or users/USER_ID:STATUS (status can be verified or unverified)member:MEMBERSHIP_IDteam:TEAM_ID or team:TEAM_ID/ROLEDoes that help? parsing with regex should be a good way to separate type and role. From there, you check what kind of role you have with a few ifs
These 2 files are how we build the string, it can help to get the full picture:
Rank 3: Container
you are awesome thanks
Rank 3: Container
@Eldad @Meldiron @Steven this can be refined in many ways but ill leave that up for you guys to decide i gotta work on my project :appwriteheart2: just make sure to keep the iserror value and turn it to true when there is an actual error.
Rank 3: Container
[SOLVED] Format permissions individually