Skip to content

Apply authorization in the shopping example #3695

@jannyHou

Description

@jannyHou

Suggestion

Add authorization system in the shopping example according to the PoC loopbackio/loopback4-example-shopping#231

Use Cases

  • Implement the authorizer using casbin
  • Decorate User endpoints and its related model's endpoints with @authorize
  • Mount the authorization component
  • Specify different roles for users, like ADMIN, CUSTOMER, etc...
  • Specify custom voter on for endpoints if needed

Acceptance criteria

  • add different roles for users, secure endpoints in user controller
  • modify existing tests to pass
  • Update the shopping example with authorization. Details see the description and user cases
  • add some document to introduce this feature

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions