Skip to content

Cannot add multiple relations to ParseRole #1202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davidruisinger opened this issue Mar 26, 2016 · 1 comment
Closed

Cannot add multiple relations to ParseRole #1202

davidruisinger opened this issue Mar 26, 2016 · 1 comment

Comments

@davidruisinger
Copy link

Environment Setup

Parse Server 2.2.2

Steps to reproduce

I'm not 100% sure wether this is a bug or intended behavior, so please correct me if I'm wrong.

I've a huge cloud function to setup my initial roles. At line 386 I add 2 relations to the "customer" role ("admin" role AND "merchant" role).
But when looking at my DB (_Join:roles:_Role collection) after running the function, it seems that only the 1st relation between the "customer" and "admin" role has been set (customerRole.getRoles().add(globAdminRole);) but NOT the 2nd relation between "customer" and "merchant" role (customerRole.getRoles().add(globMerchantRole);)

From what I understand when reading the docs I would assume that if I call the add() function twice it would add both relations.

(sidenote)
I could work around that for now by adding both relations as an array like this:

customerRole.getRoles().add([globAdminRole, globMerchantRole]);

Logs/Trace

@flovilmart
Copy link
Contributor

Yeah this is an issue with the JS-SDK, use your workaround for now. cc: @andrewimm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants