Code Monkey home page Code Monkey logo

django-admin-view-permission's Introduction

Admin View Permission

Build Status

Coverage Status

Code Climate

Reusable application which provides a view permission for the existing models.

Requirements

  • Django

Support

  • Django: 1.8, 1.9, 1.10, 1.11, 2.0
  • Python: 2.7, 3.4, 3.5, 3.6

Compatible with django-parler's translatable models. To verify which django-parler version our test suite runs against, check requirements-debug.txt. You do not need django-parler to install django-admin-view-permission.

Documentation

For a full documentation you can visit: http://django-admin-view-permission.readthedocs.org/

Setup

  • pip install django-admin-view-permission

and then add admin_view_permission at the INSTALLED_APPS like this:

INSTALLED_APPS = [
    'admin_view_permission',
    'django.contrib.admin',
    ...
]

and finally run python manage.py migrate.

You need to place the admin_view_permission before django.contrib.admin in INSTALLED_APPS.

In case of a customized AdminSite in order to apply the view permission, you should inherit from the AdminViewPermissionAdminSite class:

from admin_view_permission.admin import AdminViewPermissionAdminSite

class MyAdminSite(AdminViewPermissionAdminSite):
    ...

Configuration

This app provides a setting:

ADMIN_VIEW_PERMISSION_MODELS = [
    'auth.User',
    ...
]

in which you can provide which models you want to be added the view permission. If you don't specify this setting then the view permission will be applied to all the models.

Uninstall

  1. Remove the admin_view_permission from your INSTALLED_APPS setting
  2. Delete the view permissions from the database:

    from django.contrib.auth.models import Permission
    permissions = Permission.objects.filter(codename__startswith='view')
    permissions.delete()

    It will be helpful to check if the queryset contains only the view permissions and not anything else (for example: custom permission added)

django-admin-view-permission's People

Contributors

anton-shutik avatar awgreenblatt avatar ciarancourtney avatar kapucko avatar lanterno avatar lefterisnik avatar michi88 avatar myrikld avatar nkonin avatar orf avatar petrdlouhy avatar pinerojuancruz avatar yxy avatar

Watchers

 avatar  avatar  avatar

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.