franciscogouveia / hapi-rbac

RBAC (Rule Based Access Control) for hapijs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simplify target

franciscogouveia opened this issue · comments

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'
  }
]

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

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