djaodjin / djaodjin-saas

Django application for software-as-service and subscription businesses
Other
564 stars 124 forks source link

Replace manager/contributor by a generic role relationship - committed to customers #30

Closed rene-armida closed 8 years ago

rene-armida commented 9 years ago

I'm not 100% clear on the specifics, but we want to do some database refactoring to allow for other types of provider-style relationships. I will try to get more specifics from @smirolo and then document them as use case / stories here.

smirolo commented 9 years ago

Historically we have had Organization_Managers and Organization_Contributors two Django relation models to represent "managers" and "contributors" relationship between Organization and User. The idea is to use a single model, call it OrganizationUserRelation (lack of inspiration here) with a field to store the type of relation "contributor", "manager", etc. See Flexible Security Framework for how both managers and contributors are currently used to decide how permissions are handled.

Also historical, at some point we introduced a strength parameters to the decorator functions (WEAK, NORMAL, STRONG) that was orthogonal to the notion of User/Organization relation. To be re-evaluated if that strength idea still makes sense in the context of a generalized UserOrganizationRelation or just add unnecessary complexity.

smirolo commented 8 years ago

See commit 86e0c9de1d3f92f42754ef102c452b21c8947da1, commit f96c38d90edd1bd374986a14a2ee74211ae3b830 and commit 2c4c6c2880c0301a0fbe939e5b5a193b45afe711.