Skip to content

Missing ACL info in database object #558

Closed

Description

@mchun

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

Activity

  1. changed the title [-]Missing ACL info in database objecty[/-] [+]Missing ACL info in database object[/+] on Feb 22, 2016
  2. sanergulec commented on Feb 26, 2016

    @sanergulec

    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?

  3. mtrezza commented on Feb 29, 2016

    @mtrezza
    Member

    Same issue here

  4. flovilmart commented on Mar 7, 2016

    @flovilmart
    Contributor

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

  5. michaelfy commented on Apr 4, 2016

    @michaelfy

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

  6. mchun commented on Apr 9, 2016

    @mchun
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions