Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-guardian 1.0.4

    Download button

    No screenshots available
    Downloads: 343  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Lukasz Balcerzak | More programs
    BSD License / FREE
    March 13th, 2012, 20:06 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-guardian description

    Implementation of per object permissions for Django 1.2

    django-guardian is implementation of per object permissions [1] as authorization backend which is supported since Django 1.2. It won't work with older Django releases.

    Installation

    To install django-guardian simply run:

    pip install django-guardian

    Configuration

    We need to hook django-guardian into our project.

     1. Put guardian into your INSTALLED_APPS at settings module:

     INSTALLED_APPS = (
     ...
     'guardian',
     )


     2. Add extra authorization backend:

     AUTHENTICATION_BACKENDS = (
     'django.contrib.auth.backends.ModelBackend', # default
     'guardian.backends.ObjectPermissionBackend',
     )


    Usage

    After installation and project hooks we can finally use object permissions with Django.

    Lets start really quickly:

    >>> jack = User.objects.create_user('jack', 'jack@example.com', 'topsecretagentjack')
    >>> admins = Group.objects.create(name='admins')
    >>> jack.has_perm('change_group', admins)
    False
    >>> UserObjectPermission.objects.assign('change_group', user=jack, obj=admins)

    >>> jack.has_perm('change_group', admins)
    True


    Of course our agent jack here would not be able to change_group globally:

    >>> jack.has_perm('change_group')
    False


    Documentation

    There is an online documentation available at http://packages.python.org/django-guardian/.
    [1] Great peper about this feature is available at http://djangoadvent.com/1.2/object-permissions/.


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    per object permissions | Django guardian | object | permissions | Django

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM