0.0.1 • Published 4 years ago

@canyou/core v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Use Cases

  1. crud
  2. create
  3. read
  4. update
  5. delete

  6. crud if owner

  7. read if public

  8. roles

  9. profiles
  10. auth obj

API

articles
rules []
  allow: [*], provider: "login", operations: [read]
  allow: [author], provider: "login", operations: [*]

drafts
rules []
  allow: [author], provider: "login", operations: [*]
  allow: [reviewer], provider: "login", operations: [read]

drafts.comment
rules []
  allow: [*], provider: "login", operations: [*]
isAuthorized(subject, object, operation, scope)
where:
  subject = user/service
  object = fields needed for scope for the object in question
  scope = rules/logic

look in scope if if has
  allow == subject
  provider //todo
  && operation == operation