Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plans/subscriptions management #48

Open
gahabeen opened this issue Apr 27, 2020 · 0 comments
Open

Add plans/subscriptions management #48

gahabeen opened this issue Apr 27, 2020 · 0 comments
Assignees
Labels
feature type: additions in progress type: status priority: medium priority

Comments

@gahabeen
Copy link
Owner

gahabeen commented Apr 27, 2020

Summary

Integrate logic in order to:

  • give permissions based on a subscription a user has
  • keep track of usage to apply limitations (ex: max number of documents owned in a collection)

What it implies:

  • Plans are roles named biota.plan.<id>
  • Relation between a user (or any document) and plan is called a subscription
  • Relation is determined by a _membership.plan field on a document

Basic example

Plan definition:

// API is very similar to db.role() if not the same
db.plan('basic').insert()

// update permissions
db.plan("basic").privileges.set({
  resource: Collection('todos'),
  rights: {
    insert: ['owner']
  }
})

// expire in an hour
db.plan('basic').expireIn(3600)

// list plans
db.plans.findAll()

Motivation

Properly manage the user's permissions through a common model of plans/subscriptions.

@gahabeen gahabeen added priority: medium priority in progress type: status feature type: additions labels Apr 27, 2020
@gahabeen gahabeen self-assigned this Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature type: additions in progress type: status priority: medium priority
Projects
None yet
Development

No branches or pull requests

1 participant