Package: django-authority
This is a Django app for per-object-permissions that includes a bunch of
helpers to create custom permission checks.The main website for django-authority isdjango-authority.readthedocs.org. You can also install thein-development versionof django-authority withpip installdjango-authority==devoreasy_installdjango-authority==dev.ExampleTo get the example project running do:Bootstrap the environment by running in a virtualenv:pip install Django
pip install -e .Sync the database:python example/manage.py migrateRun the development server and visit the admin athttp://127.0.0.1:8000/admin/:python example/manage.py runserverNow create a flatage and open it to see some of the templatetags in action.
Don’t hesitate to use the admin to edit the permission objects.Please usehttps://github.com/jazzband/django-authority/issues/for issues and bug reports.DocumentationThe documenation is currently in development. You can create a nice looking
html version using the setup.py:python setup.py build_sphinxChangelog:0.14 (2020-02-07):Add Django 2.2 supportAdd Python 3.7 supportVarious fixes around the test harness.Use Django’s own method of auto-loading permissions modules.Fix Django admin incompatibility regarding a method removed years ago.Removed unused compatibility code.Fix BasePermission.assign for group permissions.0.13.1 (2018-01-28):Minor fixes to the documentation and versioning.0.13 (2018-01-28):Added support for Django 1.11Drop Support for Python 3.3Fixed a bug with template loader0.12 (2017-01-10):Added support for Django 1.100.11 (2016-07-17):Added Migration in order to support Django 1.8Dropped Support for Django 1.7 and lowerRemove SQL Migration FilesDocumentation UpdatesFix linter issues0.10 (2015-12-14):Fixed a bug with BasePermissionForm and django 1.80.9 (2015-11-11):Added support for Django 1.7 and 1.8Dropped support for Django 1.30.8 (2013-12-20):Added support for Django 1.60.7 (2013-07-03):No longer doing dependent sub-queries. It will be faster to do two small
queries instead of one with a dependent sub-query in the general case.0.6 (2013-06-13):Added support for custom user models (Django 1.5 only).0.5 (2013-03-18):It is now possible to minimize the number of queries when using
django-authority by caching the results of the Permission query. This can be
done by addingAUTHORITY_USE_SMART_CACHE = Trueto your settings.pyConfirmed support (via travis ci) for all combinations of Python 2.6,
Python2.7 and Django 1.3, Django 1.4, Django 1.5. Added Python 3.3 support
for Django 1.50.4 (2010-01-15):Fixed an issue with the UserPermissionForm not being able to override the
widget of the user field.Added ability to override form class inadd_permissionview.Added easy way to assign permissions via a permission instance, e.g.:fromdjango.contrib.auth.modelsimportUserfrommysite.articles.permissionsimportArticlePermissionbob=User.objects.get(username='bob')article_permission=ArticlePermission(bob)article_permission.assign(content_object=article)0.3 (2009-07-28):This version adds multiple fields to the Permission model and is
therefore abackwards incompatibleupdate.This was required to add a feature that allows users to request,
withdraw, deny and approve permissions. Request and approval date
are now saved, as well as anapprovedproperty. An admin action has
been added for bulk approval.To migrate your existing data you can use the SQL files included in
the source (migrations/), currently available for MySQL, Postgres
and SQLite.The templatetags have also been refactored to be easier to customize
which required a change in the template tag signature:Old:{%permission_formflatpage%}{%permission_formflatpage"flatpage_permission.top_secret"%}{%permission_formOBJPERMISSION_LABEL.CHECK_NAME%}New:{%permission_formforflatpage%}{%permission_formforflatpageusing"flatpage_permission.top_secret"%}{%permission_formforOBJusingPERMISSION_LABEL.CHECK_NAME[withTEMPLATE]%}New templatetags:permission_request_formget_permission_requestget_permission_requestspermission_request_approve_linkpermission_request_delete_linkrequest_url_for_objTheadd_permissionview is now accessible with GET requests and
allows to request permissions, but also add them (only for users with
the ‘authority.add_permission’ Django permission).