Commit graph

44 commits

Author SHA1 Message Date
Jannis Leidel
d8542ffb87
Blacken the code. 2020-02-07 10:50:47 +01:00
Jason Ward
4cf4853232 Add support for Django 2.2 (#64)
* Updated tox to test only python{2,3}.7 and djagno1.11/2.2

* Updated travis.

* Updated models/migrations.

* Updated path to `reverse`

* Updated path to login view.

* Updated middlewares/installed apps

* Updated .travis again.

* Lets see if that will get tests working in python3 on travis.

* Switch to in memory DB for tests

* Stop running tests with python2.7 and django 2.2. They shouldn't work anyway.

* Sure did that wrong. Fix which python versions are running with which code.

* That isn't needed. Lets see if that is what is breaking python3.

* Testing a theory.

* Revert "Testing a theory."

This reverts commit 69b3e4c906.

* Added initial migration for example users.

* is_authenticated is a bool, not a method.
2020-01-24 16:04:44 +06:00
Jason Ward
a868d54945 Add support for Django 1.11 (#58)
* refs #1: Updated tox + travis.

* refs #1; Fixed path to register.

* refs #1: Updated urls.py

* refs #1: Added username field. Not really sure why it was needed, but whatever.

* Added an update note.

* refs #2: Updated travis.

* refs #2: Updated command to run tests.

* refs #2: Added a test showing permission_required is busted.

* refs #2: Custom user modal needs a default manager.

* refs #2: Updated settings.

* refs #2: Stop the exception from being raised.

* refs #2: Fixed a problem with named parameters.
2018-01-19 17:37:15 +06:00
Bob Cribbs
11bc2fe188 drop support for django 1.3; use prefetch_related for m2m to user__groups 2015-11-11 00:26:21 +02:00
Bob Cribbs
2c2927f696 add compat.py file for user model 2015-11-10 22:45:10 +02:00
Bob Cribbs
9589dfc820 import admin in example so it works with dj17 2015-11-10 19:31:54 +02:00
Jenny Qian
ad61de0cae fixing invalid syntax error
Got the following error when installing django-authority:
  File "/path/to/env/build/django-authority/example/users/admin.py", line 2
    from example.users.User
                          ^
SyntaxError: invalid syntax
2014-01-29 16:18:38 -06:00
Remigiusz Dymecki
3d4dcfeaf2 Update manage.py for Django 1.6 and below 2013-12-20 20:14:07 +01:00
Remigiusz Dymecki
95cf006737 Fix import for Django 1.6 in example 2013-12-20 19:33:05 +01:00
Gunnlaugur Þór Briem
fdab7e06fd Fix use of deprecated adminmedia taglib
and ADMIN_MEDIA_PREFIX setting
2013-07-13 01:30:38 +00:00
Travis Chase
9c17430b03 Added custom user model and modified test run to use it when Django >= 1.5 2013-06-13 06:13:12 -05:00
Jason Ward
d07d8b6f90 refs #12: print functions in all the places 2013-03-18 19:11:38 -04:00
Jason Ward
b885d3ff8c refs #12: removed legacy apps 2013-03-18 17:32:38 -04:00
Jason Ward
4a9ed8aa9d refs #11: added tests for group caching 2013-03-18 15:46:34 -04:00
Jason Ward
0b152b4adf refs #10: updated the DB definition for django 1.4/1.5 2013-03-18 14:39:13 -04:00
jpic
728e87cc30 Add manage.py in example project, useful to run tests ootb with ./manage.py test authority 2009-11-02 11:32:21 +00:00
Jannis Leidel
fa4a3fbc11 Moved setting the user field widget to correct location in UserPermissionForm 2009-10-12 15:45:06 +02:00
Jannis Leidel
950061cb75 Show how to override a form in the add_permission view in the example project 2009-10-12 14:56:10 +02:00
Jannis Leidel
c3208b2b34 Added date_requested and date_approved fields to Permission model, to accompany the permission request changes. This requires a schema change.
Fixed legacy permission name "approve_permission_requests".
Fixed forms to not bypass validation for permission requests.
Combined the templates for permission requests forms and permission forms in one file.
Added ability to withdraw a permission request, along the lines of the permission denial.
Updated URLs to be more awesome.
Refactored template tags to be classbased, easier to use.
Changed signature of permission_form templatetag and added ability to pass a template name with which the form should be rendered.
Combined permission_form and permission_request_form in one template tag class.
Added utility to determine best URL to redirect to after successful permission (request) creation.
Made sure the new GET access to the permission form views is secure. Please test!
Added new "approve_permissions" admin action to easily approve permissions in the admin.
Updated default templates to use the new features.
Now dance.
2009-07-23 07:33:34 +02:00
Diego Búrigo Zacarão
a92e3da0fd Added Permission Request feature
- Permissions are considered requests until the 'approved'
   field be set to True
2009-07-22 12:05:07 -03:00
Jannis Leidel
bf0b9c3678 Moved add_url_for_obj function to templatetag lib and registered it as a template tag 2009-07-14 18:51:12 +02:00
Jannis Leidel
340cbb9c73 Fixes issue #2 - Adds ability to pass non-lookup parameters in decorator to permission check. 2009-07-10 15:55:25 +02:00
Jannis Leidel
494649b1d4 Updated example permission to follow new-ish registry layout 2009-07-10 01:47:29 +02:00
Jannis Leidel
210c0e032b Made the register and unregister methods public 2009-07-10 01:21:08 +02:00
Jannis Leidel
13cc721580 Refactored permission class registration. 2009-07-10 01:07:20 +02:00
Jannis Leidel
31eba894d8 Fixed backwards incompatibility with admin. 2009-07-07 14:50:49 +02:00
Jannis Leidel
f9f0f63805 Added site-wide admin action (1.1 only) for editing permissions of arbitrary objects. 2009-07-07 02:12:08 +02:00
Jannis Leidel
a8fd0b25ca small update to example docstring 2009-07-07 00:44:14 +02:00
Jannis Leidel
1cfcf334ce Overhaul to the templatetags. New templatetag get_permission to perform a specific permission check. 2009-07-07 00:20:36 +02:00
Jannis Leidel
b1356e8761 Back to tuple style syntax for permission required decorator. 2009-07-06 21:57:16 +02:00
Jannis Leidel
18969fa389 Fixed oversight in example flatpage template. 2009-07-06 19:03:33 +02:00
Jannis Leidel
8aceec2104 Updated example for permission_required_or_403 decorator to follow new syntax. 2009-07-06 16:07:24 +02:00
Jannis Leidel
6740e52369 Introduce a new syntax for the decorator to not rely on the order of the arguments passed to the view function. That failed because kwargs is a dict, d'oh. 2009-07-06 16:03:56 +02:00
Jannis Leidel
0b369d9310 Renamed verbose_name attribute of permission checks to short_description for consistency 2009-07-04 11:06:01 +02:00
Jannis Leidel
287d2eccd5 Fixed decorator to only check for permissions if user is logged in. Added permission_denied view to be used when permission check unsuccessful, e.g. with the new permission_required_or_403 decorator. The permission_required decorator will redirect to the login form by default. 2009-07-03 15:41:21 +02:00
Jannis Leidel
62b8c12077 Add an alternative Django 1.0.2 section to the buildout. Use django-debug-toolbar's released version instead of latest development version. 2009-07-03 15:34:42 +02:00
Jannis Leidel
3c34e7482d Added an example of the decorator to the docstring of the example view. Fixed verbose name of top_secret permission check of example app. 2009-06-22 16:09:06 +02:00
Jannis Leidel
3e047dc5fe Updated example project to use the latest additions to django-authority 2009-06-22 01:07:26 +02:00
Jannis Leidel
539a8bf637 Removed some debug print statements and got rid of the importlib in authority.autodiscover() 2009-06-12 01:57:08 +02:00
Jannis Leidel
6163e02b26 A short description for the example FlatPagePermission 2009-06-12 01:22:43 +02:00
Jannis Leidel
ff0150398c Updated the FlatPage permissions to work with the latest changes. Added a custom permission check 'top_secret'. Added more examples to flatpage template. 2009-06-12 01:12:51 +02:00
Jannis Leidel
ea8f0168e8 Removed ipython and added django-extensions, django-debug-toolbar 2009-06-12 01:00:04 +02:00
Jannis Leidel
1676c12e30 made flatpage template nicer, heh 2009-06-08 13:19:14 +02:00
Jannis Leidel
96a80d27a1 Added example project 2009-06-08 12:03:49 +02:00