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

  • SEARCH
  • Home
  • 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 137635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:08:14+00:00 2026-05-11T07:08:14+00:00

I added a new model with one permission, and now I need to add

  • 0

I added a new model with one permission, and now I need to add that permission to a few users on the production machine after deploying the code and running syncdb for the new app involved. I haven’t found the correct way to do this. The auth docs mention User.user_permissions.add(permission), but never tell me what ‘permission’ is or the best way to get it.

  • 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. 2026-05-11T07:08:15+00:00Added an answer on May 11, 2026 at 7:08 am

    Permission (which lives in django.contrib.auth.models) is a database object. You’ll be able to see all of them with Permission.objects.all(). They are created automatically by a post-sync signal for each model (and as the docs mention, you can also define your own).

    To assign the permissions to a User, you will first have to get the Permission objects (using Permission.objects.get(*args)), and then you can add it to the User with User.user_permissions.add(permission) as you mentioned.

    Alternatively, and the easier way if you can do this, is just to use the Django admin site. In the detail page for each user, there is a section relating to permissions. I’m guessing you aren’t using these permissions outside of the admin, so that’s the only area they will affect. If you want all of your users to have all permissions, you can make them superusers by setting the is_superuser flag on each User to True.

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

Sidebar

Related Questions

I have one model User with Devise gem. I added a new field called
I created new version of CoreData model (added one new attribute to entity) and
I have IIS 7.5 With one web site I added new virtual directory and
I removed my .gitconfig by accident. I added new identies by git add [file]
This is my xml now. There can be added new item nodes and I
I added a new subdir within my git respository: git add feeds Then commited
We recently created new groups within our CMS to avoid users being added directly
My ability model for cancan has been working well for 6+ months now. One
I've added a new entity (Site) to my Core Data Model, and a relationship
I created a routing test rails3 app with one model 'User': rails new routing_test_app

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.