loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Ids colliding between multiple models inherited from User

Open rgalite opened this issue 10 years ago • 3 comments

EDIT: June 15th 10:02 GMT+2

Hi,

I have a model Order for which I want the owners, service account or admin to access.

{
  "name": "Order",
  "plural": "Orders",
  ...,
  "acls": [
    {
      "principalType": "ROLE",
      "principalId": "$owner",
      "permission": "ALLOW",
      "property": "*"
    },
    {
      "principalType": "ROLE",
      "principalId": "service",
      "permission": "ALLOW",
      "property": "*"
    },
    {
      "principalType": "ROLE",
      "principalId": "admin",
      "permission": "ALLOW",
      "property": "*"
    },
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "DENY",
      "property": "*"
    }
  ]

And the models ServiceAccount and Customer both inherit form User.

I created 2 records : customerA, customerB and serviceA. customerB's id == sericeA's id.

I created a record order which customerA owns. customerA is the owner and can access the order. serviceA has the role service, therefore can access the order. customerB can also access the record - because having the same id as the serviceA it gets the role service.

customerB should not have the role service.

Is it possible that loopback is not checking the type of the logged user?

Thanks for your help.

rgalite avatar Jun 14 '16 15:06 rgalite

Would you mind forking the loopback-sandbox with your project so that I can reproduce the problem with the same configs you have? Thanks!

https://github.com/strongloop/loopback/wiki/Reporting-issues#bug-report

0candy avatar Jun 15 '16 14:06 0candy

@RudthMael Closing due to inactivity. If you are still running into problems, feel free to leave a comment and I will reopen the issue.

0candy avatar Nov 03 '16 19:11 0candy

I am also experiencing this issue. Can it be reopened?

DerekTBrown avatar Dec 28 '17 23:12 DerekTBrown