Can somebody please explain to me the exact differences between a ParseRole
and a ParseRelation
? I'm trying to figure out which one is more suitable for me to use and so far I can't see many differences. I originally thought that ParseRole
was a many-to-many relationship and ParseRelation
was a one-to-many, however it appears they're both many-to-many. Any light shed on the matter would be of great help!
Asked
Active
Viewed 188 times
1

Manuel
- 14,274
- 6
- 57
- 130

edwoollard
- 12,245
- 6
- 43
- 74
1 Answers
2
ParseRole is a term used to define the role a User has, that is, what objects it can access. It is used in conjunction with ACLs (Access Control Lists) to add a layer of data security, ensuring only valid users access it.
Imagine a game whose backend is provided by Parse, this game has user generated levels and there's a group of players denoted "moderators". Moderators can delete other's levels if it breaks the game's rules. You only want them to be able to delete any level, so you create a role named moderator
and assign delete permissions to it in the Level
class' ACL.
ParseRelation, in the other hand, is a many-to-many relation between any kind of object.

This company is turning evil.
- 5,021
- 5
- 34
- 58
-
Yeah that makes sense for `ParseRole` but I still don't really know when I'd use a `ParseRelation` over a `ParseRole`. – edwoollard Feb 05 '14 at 17:39
-
Roles only serve the purpose of limiting access to objects, relations can express anything between two sets of objects. – This company is turning evil. Feb 05 '14 at 17:49
-
So an example of using a `ParseRelation` would be? – edwoollard Feb 05 '14 at 17:54
-
A Facebook user and their posts. – This company is turning evil. Feb 05 '14 at 18:30
-
Thanks a bunch mate. Really helpful. I've decided to use Roles for my solution then. – edwoollard Feb 05 '14 at 18:31
-
It would be useful to add more explanation of the `ParseRelation` to your answer, also bonus points for talking about arrays of pointers for lightweight use. – Timothy Walters Feb 05 '14 at 22:17