On Mon, Apr 15, 2013 at 12:44 AM, Nora Olsen <nora.olse...@gmail.com> wrote:

> Hi,
>
> I'm using Django 1.5 and I have looked at guardian / Userena / pinax user
> accounts but I'm not sure how they work with the authentication mechanism
> in Django.
>
> I'm creating a site that typically have the following the groups :
> 1. Super Admin: Myself
> 2. Organization admin. This is created by super admin only.
> 3. Organization user group: A, B, C, such as editors, moderators, finance,
> hr, etc
>
> These user groups have the same role regardless of the organization.
>
> This is similar to most site, such as mailchimp/mixpanel/aws/etc, that the
> first account is an admin account. Using that admin account, the user will
> be able to create other accounts and assign roles to them. Roles come with
> fix set of permissions across the entire site.
>
> I'm trying to create a typical site with a login page with email &
> password. Upon login, the organization admin would be able to access the
> "Organization accounts" under his/her dashboard to manage their users.
>
> If it's a normal user, he/she can only see their own profile and perform
> the necessary actions specific to their roles.
>
> Should I be using the Admin Site? But the organization admin is really not
> a super user/staff member of the app.
>

This question is orthogonal to your other questions. Django's Admin site
isn't intended as a general purpose, user-facing administration console for
your site. It's intended for internal site administration use only.

If you're making a distinction between your own site administrators, and an
"administrator" role amongst a particular group of users/organization, then
you'll almost certainly have a separate administration interface for those
users -- but that doesn't preclude you from using Django's Admin for your
own internal administration.


> What about the User model? Should I be creating my own models?
>

Should you be creating your own Models? Almost certainly -- you'll need to
store organisation data *somewhere*.

Should you be creating your own User model? Possibly.

I can see two obvious approaches you could take.

 1) An Organization model with an m2m relation with a stock Django User.
This would allow users to belong to multiple organisations.

 2) A custom User model that has a foreign Key to Organization. This would
require every user to belong to at least one organisation (unless you make
the foreign key nullable)

Then there's the question of permissions. If every organisation will have
the same set of permissions (e.g., can create new User, can moderate
content, etc), then you can probably just use Django's own groups and
permissions model, and make sure that every time you check a permission you
also check organisation ownership.

Of course, all of this depends on the exact permissions model you want for
your own site, and ultimately only *you* can determine that.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to