Skip to content

Can not delete a data row with ACL(Using Role to check ACL) #1948

Closed
@ntloc592

Description

@ntloc592

Issue Description

I can not delete a row after created.

Describe your issue in as much detail as possible.

Steps to reproduce

  1. Create role with name "Admin", create user admin, set role Admin for this user
  2. Login with admin user and create a "Tag" object
    • ACL: Role admin
      + Read: true
      + Write: true
  3. Delete this tag
    • Result:
      {
      code: 101,
      message: 'Object not found.'
      }

image

Expected Results

Can detete this row

Actual Outcome

 Somtime return error, sometime can delete this row
 {
   code: 101,
   message: 'Object not found.'
  }

Environment Setup

  • Server
    • parse-server version: 2.2.10
    • Operating System: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [FILL THIS OUT]
  • Database
    • MongoDB version: [FILL THIS OUT]
    • Storage engine: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [FILL THIS OUT]

Logs/Trace

With My debuging

image

In this function (view image), I found some wrong when debuging

  • File /src/Auth.js
  • Sometime, system will get user role from cache at line 102, but this.userRoles=[]
  • System will check permission by this.userRoles at line 75 in next image
    • File /src/rest.js
      image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions