I have a ruby app running with declarative authorization and I have made the roles:
admin ( app admin ) org_admin ( organization administratr ) org_colab ( organization colaborator ) org_visitor ( organization visitor )
a User can has_many Organizations and he can be an admin or a colaborator.
I link them using a Affiliation table
What is the best strategy to solve this many to many roles?
To put a extra attribute on the Affiliation table ? like : Affiliation(:user_id:integer, :organization_id:integer, :affiliation_type:integer)
and the affiliation type can be 0 for org_admin and 1 for org_colab and 2 for org_visitor?
I imagine there must be a better way to assign roles to a particular organization...