Skip to content

How $owner is checked is too loose #2933

@cfjedimaster

Description

@cfjedimaster

Bug or feature request

  • Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

When you define an ACL related to $owner, LB uses the following rules to determine if you are the owner:

  1. a relation to a model that extends user. 2) a simple property called userId. 3) a simple property called owner

However, imagine a model called cat. It has a relation called creator that points to a User. It also has a relation called "personIPukeOn", that also points to a User. In this scenario, if a cat pukes on me, but I'm not the owner, LB will still I'm the owner because the relationship points to a User model.

Link to sample repo to reproduce issue (if bug)

Expected result

Actual result (if bug)

Additional information (Node.js version, LoopBack version, etc)

Metadata

Metadata

Assignees

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