Skip to content
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

Issue saving a Role #80

Closed
didierfranc opened this issue Jan 30, 2016 · 13 comments
Closed

Issue saving a Role #80

didierfranc opened this issue Jan 30, 2016 · 13 comments
Labels
type:question Support or code-level question

Comments

@didierfranc
Copy link

Hi, everything seems fine until I try to set ACL and Role.

capture d ecran 2016-01-30 a 15 19 28

@davidaik
Copy link

+1 We need fully working ACL and CLP.

@didierfranc didierfranc changed the title Is ACL/Role working with parse-server ? Does ACL/Role work with parse-server ? Jan 30, 2016
@akships
Copy link

akships commented Jan 30, 2016

+1

@wangmengyan95
Copy link
Contributor

Hi @didierfranc, is it possible for you to paste the stacktrace of your server?

@gfosco
Copy link
Contributor

gfosco commented Jan 30, 2016

Roles and ACLs were implemented, and there are test scenarios you can see under the spec/ folder. If you can construct a failing test, that would be the most helpful, otherwise try to get the full response from the server and the logs.

@gfosco gfosco changed the title Does ACL/Role work with parse-server ? Issue saving a Role Jan 30, 2016
@didierfranc
Copy link
Author

Yes I saw that spec samples, I'll check that and post result here.

@didierfranc
Copy link
Author

Maybe answer is that we can't use/set Roles as before

// Roles are not accessible without the master key, so they are not intended
// for use by clients.  We can manually test them using the master key.

https://github.com/ParsePlatform/parse-server/blob/master/spec/ParseRole.spec.js

@gfosco
Copy link
Contributor

gfosco commented Jan 31, 2016

Well, roles even on hosted parse require the master key. So this is working as intended. Initialize with the master key and pass useMasterKey: true in the save call.

@didierfranc
Copy link
Author

@gfosco The function in the first post is part of my installation script to define an admin, user roles ... it runs (client side) well with Parse.com not with the new parse-server.

So everything is fine if I set the masterkey

Parse.masterKey = 'myMasterKey'
// ...
role.save({}, { useMasterKey: true })

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

I check and you're right, the REST API Key was allowed to affect Roles on hosted Parse... I think it's better here in parse-server to require the master key.

@gfosco gfosco closed this as completed Feb 2, 2016
@ledowong
Copy link

ledowong commented Feb 8, 2016

I used very long time to find this post. I think this should be in the README because it is very very important.

For me, my app is a web app using JS SDK. Now read Role, create object and save object are not working.......

For read Role, I can just hardcode my username, to check if the loggedIn user is allowed to edit.
However for create/save, it only works with masterKey :(

It doesn't make sense to put the masterKey in JavaScript...
That mean whole thing broken now.

Any workaround? Thanks.

@ledowong
Copy link

ledowong commented Feb 8, 2016

@gfosco

@didierfranc
Copy link
Author

I opened this thread, I gave the non solution of masterkey I'll work on a real one based on Cloud code

@aitchkhan
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

8 participants