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

Missing ACL info in database object #558

Closed
mchun opened this issue Feb 22, 2016 · 5 comments
Closed

Missing ACL info in database object #558

mchun opened this issue Feb 22, 2016 · 5 comments
Labels
type:question Support or code-level question

Comments

@mchun
Copy link

mchun commented Feb 22, 2016

I used the following code on server side for saving object:

app.post('/',requireUser, function(req, res) {
    var post = new Post();
    post.set("Category",req.body.Category)
    var acl = new Parse.ACL();
    acl.setPublicReadAccess(true);
    acl.setRoleWriteAccess("admin", true);
    acl.setWriteAccess(req.user, true);
    post.setACL(acl);
    post.save(null,{sessionToken:req.user.sessionToken});
  });

And this is the data saved in MongoDB

{
    "_rperm": [
        "*"
    ],
    "_wperm": [
        "role:admin",
        "SPtdQePtm2"
    ],
}

Unlike previously, there is also acl related data saved in the object, i.e.

    "_acl": {
        "*": {
            "r": true
        },
        "SPtdQePtm2": {
            "w": true
        },
        "role:admin": {
            "w": true
        }
    },

And consequence and is that a bug? P.S. I am using parse-server 2.1.2

@mchun mchun changed the title Missing ACL info in database objecty Missing ACL info in database object Feb 22, 2016
@sanergulec
Copy link

Hello, I have a similar issue, when I use the code below in my xcode xwift project, in the mongolab part the objects are written as below, and the ACL settings in the parse dashboard are not changed.

  let acl = PFACL()
  acl.publicReadAccess = true
  acl.publicWriteAccess = false
  userSettingObj["ACL"] = acl

   "_rperm": [
      "*"
    ],

However when I make the changes from the dashboard of parse, the mongolab acl record is like:

"_acl": {
        "*": {
            "r": true
        },
    },

  "_rperm": [
      "*"
    ],

What may be the reason?

@mtrezza
Copy link
Member

mtrezza commented Feb 29, 2016

Same issue here

@flovilmart
Copy link
Contributor

ACL are transformed when saved to mongodb for performance optimization reasons. Do you have problem with objects that should not be read?

@michaelfy
Copy link

Hi @gfosco Is this issue resolved? We are still seeing the same issue in 2.2.4.

@mchun
Copy link
Author

mchun commented Apr 9, 2016

I guess it is related to #1317 , the compatibility between self hosted parse and parse.com

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

6 participants