franciscogouveia / hapi-rbac

RBAC (Rule Based Access Control) for hapijs
ISC License
105 stars 20 forks source link

Simplify target #17

Closed franciscogouveia closed 8 years ago

franciscogouveia commented 8 years ago

Instead of

target: ['all-of',
  {
    type: 'username',
    value: 'fgouveia'
  },
  {
    type: 'group',
    value: 'writer'
  }
]

Do something like this for an AND condition

target: {
  username: 'fgouveia',
  group: 'writer'
}

Use an array for a combination of AND and OR condition

target: [
  {
    username: 'fgouveia',
    group: 'writer'
  },
  {
    username: 'anonymous',
    group: 'reader'
  }
]
gitawego commented 8 years ago

very good idea, hope this will be done soon :)

franciscogouveia commented 8 years ago

Coming soon ;)

https://github.com/franciscogouveia/rbac-core/issues/12

franciscogouveia commented 8 years ago

Done!

gitawego commented 8 years ago

it's getting better and better. simple and powerful :) thanks a lot