javaandroidparse-platformparse-android-sdk

Difference between ParseRole and ParseRelation


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!


Solution

  • 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.