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.
im thinking of using regex expressions but thinking further they dont come in expected orders
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:
anyguestsusersorusers/USER_IDorusers/USER_ID:STATUS(status can beverifiedorunverified)member:MEMBERSHIP_IDteam:TEAM_IDorteam:TEAM_ID/ROLE
Does 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:
you are awesome thanks
@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.
[SOLVED] Format permissions individually
Recommended threads
- [SOLVED] curl error Number: 6 β function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.
- Team invite - 500 error - no email
When executing ```dart await _repository.teams.createMembership( teamId: event.listId, roles: ['member'], email: event.email, url: 'xxxx', ); ``` I se...