mozilla/build-relengapi — pull request #34 by djmitche (2014-04-14 19:18:47+00:00)
Title: Support roles better

Add some nice syntax, along with tests and docs, for specifying roles
and permissions with Flask-Principal

My concern with this is whether "roles" are the thing we want to organize around. The other option is "permissions". Some examples might distinguish:

Roles:
* `userauth.admin`, `mapper.reporter`, `clobberer.developer`

Permissions:
* `userauth.perms.edit`, `mapper.mapping.insert`, `clobberer.clobber.branch`

I lean toward roles since we'll be mapping LDAP groups, which tend to be role-based. But permissions seem to be more explicit ("you can do this thing"). Also, when we get into API-based access, we'll want users to be able to grant limited permissions to other applications, which doesn't map well to roles.

This could be pretty easily reconfigured to support permissions with little more than `s/role/permission/g`, so there aren't a lot of technical reasons to prefer one over the other.