Django-perms

Latest version: v2.1.0

Safety actively analyzes 621363 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.1.0

In progress...

2.0.0

- Removed the old method of registering permissions into a global
registry via the `permission` decorator. This method injected
a `decorator` global into modules where the `permission` decorator was
used to register permission functions. `decorator` would then be
imported into view modules to require permissions on views. That was
a less-than-ideal way to do things and has been deprecated for some
time.

1.4.0

- When a function is registered as a permission function via
`PermissionsRegistry.register()`, a wrapped version of the function is
now returned that takes the `allow_anonymous`, `allow_staff`, and
`allow_superuser` options into account. This wrapped version is the
same function that gets registered as a template filter.

Previously, when a registered permission function was called directly
(e.g., in view code), those options would be silently ignored. Now,
using a permission as a view decorator or a template filter or by
calling it directly will yield the same results.

- In the wrapped versions of permission functions that are returned from
`PermissionsRegistry.register()`, only return `False` when the `user`
arg is `None` and not whenever it's not of the "correct" type.

1.3.0

Functional Changes

- Added Django REST Framework's request class to the default list of
expected request types. DRF seems popular enough to warrant this.

Other Changes

- Added a description of the project to the README.
- Updated the README to document the preferred style of registering
permissions via an explicitly-created permissions registry.
- Added a new & improved Makefile.
- Added change log file to package manifest.
- Cleaned up change log.
- Added support for Python 3.5.
- Added tox dependency and configuration for testing multiple Python and
Django version combinations.
- Added Python 3.4 to list of versions to test under Travis CI.
- Added linting when running tests (via flake8).
- Cleaned up some lint found by flake8.
- Fixed a few things, mostly test-related, to support Django 1.9.
- Removed nose and django_nose dependencies; Django's `DiscoverRunner`
is used to discover and run tests instead.
- Dropped support for Python 2.6.

1.2.1

Fixed

- `PermissionsRegistry._get_user_model()` was unintentionally
decoratored with `property`.

1.2.0

Deprecated

- Object-notation access to permissions will be removed in 2.0. All
views should be decorated using `permissions.require('perm_name')`
instead of `permissions.perm_name`.

Changed

- Template filters now immediately return False if they're passed
a non-user object (that is, an object that is not an instance of
get_user_model() or AnonymousUser). This makes these template filters
less likely to crash the page.
- Template filters now bypass the call to the permission function for
anonymous users when anonymous users aren't allowed.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.