Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8991571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:45:34+00:00 2026-06-15T22:45:34+00:00

I have a Organization and Employee models class Organization(models.Model): is_active = models.BooleanField() name =

  • 0

I have a Organization and Employee models

class Organization(models.Model):

    is_active = models.BooleanField()
    name = models.CharField(u'Name', max_length = 255)
    ...

class Employee(models.Model):
    user = models.OneToOneField(User)
    organization = models.ForeignKey(Organization)
    ...

Will it be good if I use AUTH_PROFILE_MODULE, so Employee becomes user profile?

This way I can use Django permission system to set employees permissions, like

  • can see all documents
  • can see own organization documents
  • can see his own documents

Is is OK to have a permissions that are not a global one like “can see all documents“?

And what If I also want to have a permissions per Organization? How to do this? And how to distinguish permissions per Organization and per Employee?

Edit: I’m using Django 1.4

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:45:35+00:00Added an answer on June 15, 2026 at 10:45 pm

    In short, yes, you’re ok.

    Because:

    1) Using AUTH_PROFILE_MODULE=Employee will make Employee instance to be available for instance in this way:

    def view(request):
        employee_instance = request.user.get_profile()
    

    2) Using custom permissions is easy, see: https://docs.djangoproject.com/en/dev/topics/auth/#custom-permissions

    Edit:

    having custom permissions on organizations is possible as well, probably best if you create permissions programatically, like mentioned in the manual, this way:

    content_type = ContentType.objects.get(app_label='myapp', model='Organization')
    permission = Permission.objects.create(codename='can_do_something', name='Can Do something',
                                           content_type=content_type)
    

    now, you have permission aware organization model, you just assign it to your user.

    To clarify more:

    Django auth system is sort of a fixed ACL. You assign roles to a user (or group) and that’s pretty much it. Django offers helper wrapper function to easily filter out users who don’t have a given permission. If you need to decide at runtime and/or in more generic way, whether an object has permission to do something, you either need full blown ACL system (and which django.auth is not) or you code that kind of behavior yourself. This depends on your needs and obviously on the need to manage those permissions. In the OP’s case, the behavior is fixed, therefore I would recommend just coding this in and be happy. But the needs may vary and so does the solution. Django auth is good at assigning static permissions to user, gropu or a “profile” object. What that means to your app is up to you in the end.

    So in this case, the good solution would be to have a fixed set of permissions like “can view own documents” or “can view organization documents” that is assigned to user/group. And you app should decide, what it means and serve documents accordingly, taking either runtime state in the account or using models structure to determine the proper data set to serve.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following class structure: class Organization { string Name; List<User> users; List<Organization>
I have this relationship : class Organization < ActiveRecord::Base has_many :users end class User
I have an organization class class Organization { hasMany = [member:Members] } class Members
I have an Organization model that has_many users through affiliations. And, in the form
I have a organization name table with the following structure given below: CREATE TABLE
I have Address and Organization tables. Address has FK named organizationID . Address class
I'm struggling to find a pythonic approach to the following class organization: I have
I have the following tables in my database: Employee Table which consists of Name,
I have two tables. **Employee** EmpId NOT NULL (PK) Name NOT NULL OrgID NULL
I am developing a C# application and have an Employee class and an Organisation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.