This blog has been archived. Our writing has moved to makandra cards.
The blog of , a Ruby on Rails development team

Why Aegis does not support multiple roles per user

The number one feature request for our role-based permissions gem Aegis is support for multiple roles per user. It's also the one request we refuse to implement on a weekly basis.

Our belief is that you should only distinguish roles that have fundamentally different ways of resolving their permissions. A typical set of roles would be

  • anonymous guest (has access to nothing with some exceptions)
  • signed up user (has access to some things depending on its attributes and associations)
  • administrator (has access to everything)

We don’t do multiple, parametrized roles like "leader for project #2" and "author of post #7". That would be reinventing associations. Just use a single :user role and let your permission block query regular associations and attributes.

Update: Aegis now supports multiple roles per user

Growing Rails Applications in Practice
Check out our e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Recent posts

Our address:
makandra GmbH
Werner-von-Siemens-Str. 6
86159 Augsburg
Germany
Contact us:
+49 821 58866 180
info@makandra.de
Commercial register court:
Augsburg Municipal Court
Register number:
HRB 24202
Sales tax identification number:
DE243555898
Chief executive officers:
Henning Koch
Thomas Eisenbarth