apstanisic / zmaj

Zmaj is a headless CMS for managing database
https://zmaj.vercel.app
MIT License
5 stars 0 forks source link

Should there be multiple permissions on same resource and action #9

Open apstanisic opened 2 years ago

apstanisic commented 2 years ago

Currently it's guarded with composite unique key that one role can only have single resource and action For example:

[
  {
    "resource": "posts",
    "action": "read",
    "fields": null,
    "conditions": { "published": true }
  },
  {
    "resource": "posts",
    "action": "read",
    "fields": ["title", "published_at"],
    "conditions": { "published": false }
  },
]

In this case user can see everything if post is published, and only title and when will post be published, if it's not published