Overview
freeperms provides a simple and generic way to expose an application’s permissions to anonymous users. Take a wiki app or an issue tracker for example. In one deployment it might be appropriate to require a user login to edit pages or submit tickets for bugs, but in another deployment you might want to allow anonymous editing.
Applications that take advantage of the django.contrib.auth permissions framework (outside of django.contrib.admin) can be used with freeperms so that they don’t directly need to handle delegating features to anonymous users.
Usage
Add the middleware to your settings, at the end:
MIDDLEWARE_CLASSES = (
'freeperms.middleware.AnonymousPermissionsMiddleware'
)
Then expose the permissions you want to grant to anonymous users:
ANONYMOUS_PERMISSIONS = (
'wiki.add_page',
'wiki.change_page',
'wiki.delete_page',
'tickets.add_ticket',
'tickets.change_ticket',
)
You can also register or unregister permissions from anywhere in your Python code:
>>> import freeperms
>>> freeperms.register('wiki.add_page')
>>> freeperms.unregister('wiki.add_page')
Settings
ANONYMOUS_USERNAME
The username to use for anonymous users.
ANONYMOUS_PERMISSIONS
A sequence of permissions in the form ‘app_label.code_name’.
Changelog
0.1
Initial release.
Metadata
Release files for django-freeperms 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-freeperms-0.1.tar.gz | 3.5 kB | Without provenance | Details for django-freeperms-0.1.tar.gz |
Release files / django-freeperms-0.1.tar.gz
| Download URL | django-freeperms-0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1cbb96ed45749c25d02d5c7a308462bfaaa76e21f174c658de77a44e96e76a41
|
|
BLAKE2b-256 checksum How to use checksums |
bdba6fac4d0e7f3c947a4d66222ab5ab2684ebe6bd1e521b454ceb917d331b5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-freeperms 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.