asm-products/buckets — pull request #14 by oliger (2014-06-01 14:29:57+00:00)
Title: [WIP] Roles for users

#### Implementation

I've tried to make something simple... A `role` is embedded in a user, it can be global ('admin') or scoped to a ressource ('editor' of a bucket).

I'm not sure of embedding role documents inside user documents.

#### API

- `GET buckets/:bucket_id/members`: It returns a list of users that have a role in a given bucket.
- `PUT buckets/:bucket_id/members/:user_id`: Allow to add or update the `role` of a user in a given bucket.
- `DELETE buckets/:bucket_id/members/:user_id`: Remove a user from a bucket.

#### TODO

- [ ] Define role and permissions.
- [ ] Validate role when using `#upsertRole`.
- [ ] Moar tests...

What do you guys think?