Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django user groups only for permissions?

I'm a bit unsure what to use Django user groups for.

I have an application where every user belongs to a different organisation. The organisations don't have anything to do with read/write permissions. It's just a way to separate groups of users. Every organisation needs some additional fields, like a name, URL, and email address. New organisations will be added to the system over time. Within every organisation, users can have different permissions for moderation and administration, for which I (also) want to use user groups.

My question: Should I use Django's user groups to define the organisations, or should I just make an 'Organisation' model with a relation to the user?

like image 501
JacobF Avatar asked Dec 02 '13 11:12

JacobF


1 Answers

Nope. User groups are made for different reasons. You CAN use them to define organisations but I think you should think bit further ahead:

  • will the organisation require more fields than just name?
  • perhaps you will need permissions in the future to define users roles within organisations?

I'm sure you can come up with more things to think of. But if you answered yes to one of those questions then just create your Organisation model.

like image 150
Odif Yltsaeb Avatar answered Sep 20 '22 17:09

Odif Yltsaeb