Giter Site home page Giter Site logo

Comments (4)

lefterisnik avatar lefterisnik commented on August 18, 2024

Hi @joelion,

Yes, you need only to add it to INSTALLED_APPS and run migrate. The package doesn't contain any actual migrations. It uses migrate to create the new permissions on the db (like django does for the default permissions).

I hope this to answer your question.

Thanks,
Lefteris

from django-admin-view-permission.

joelion avatar joelion commented on August 18, 2024

Got it. I was expecting more fanfare, so I didn't even check the admin page to see if it changed.

However, now as soon as I enable the plugin and go to admin, I don't have any permissions to see or do anything on the admin site.
image

My account is a superuser (screenshot taken when plugin isn't enabled)
image

from django-admin-view-permission.

lefterisnik avatar lefterisnik commented on August 18, 2024

Hi @joelion,

This not normal. Superuser should have the ability to see all the models.

Did you add the 'admin_view_permission' at the top on the INSTALLED_APPS? To see what's going wrong you can run python manage.py shell and execute the following commands:

from django.contrib.auth.models import User
u = User.objects.get(username=<your username>)
u.user_permissions.all()
u.groups.all()

Both commands should return empty querysets. Otherwise set the user permissions and groups to null and try to login as superuser again.

Thanks,
Lefreris

from django-admin-view-permission.

joelion avatar joelion commented on August 18, 2024

Great, got it. I didn't realize that the order in INSTALLED_APPS mattered. Putting admin_view_permission at the top got everything working as expected.

Really surprised this feature it's built-in functionality... thanks

from django-admin-view-permission.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.