gahabeen / biota

A simple database framework for Fauna
https://gahabeen.github.io/biota
MIT License
54 stars 2 forks source link

Add plans/subscriptions management #48

Open gahabeen opened 4 years ago

gahabeen commented 4 years ago

Summary

Integrate logic in order to:

What it implies:

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.