Django Sharing
Django row level sharing app limiting content access by user in Django admin.
Features
Provides admin view, change and delete permissions, restricting content access and limiting available actions per user.
Filters ForeignKey fields by view permissions.
Filters ManyToManyField fields by view permissions.
Automatically enables sharing on all admin classes (optional).
Installation
Install or add django-sharing to your python path.
Add 'sharing' to the project’s INSTALLED_APPS setting.
Add 'sharing.backends.SharingBackend' to the project’s AUTHENTICATION_BACKENDS setting.
Usage
In order for django-sharing to limit content access your various admin classes need to include the ShareAdminMixin class. For example:
# admin.py
from django.contrib import admin
from sharing.admin import ShareAdminMixin
class ArticleAdmin(ShareAdminMixin, admin.ModelAdmin):
pass
admin.site.register(Article, ArticleAdmin)
It is crucial for ShareAdminMixin to be the first ancestor class in the admin class’ definition.
Alternatively you can automatically enable sharing for all models registered with the admin site. django-sharing includes an admin_mixin_share method which will apply the ShareAdminMixin class to all models registered with the admin site. Call the method after admin.autodiscover() in urls.py:
# urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
import sharing
admin.autodiscover()
sharing.admin_mixin_share()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
)
Once the ShareAdminMixin class has been applied your admin change views should include Group and User share inlines and restrict content appropriately.
Changelog
0.0.2
Resolved class name issue on save_model.
0.0.1
Initial release.
Metadata
Release files for django-sharing 0.0.2
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-sharing-0.0.2.tar.gz | 8.2 kB | Without provenance | Details for django-sharing-0.0.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_sharing-0.0.2-py2.6.egg | Legacy Egg format | - | - | Details for django_sharing-0.0.2-py2.6.egg |
| django_sharing-0.0.2-py2.5.egg | Legacy Egg format | - | - | Details for django_sharing-0.0.2-py2.5.egg |
Total release size: 38.3 kB
Release files / django-sharing-0.0.2.tar.gz
| Download URL | django-sharing-0.0.2.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
007147c77910c3346f9028895221c9b8778ed86c197857f43371030d56a64d9d
|
|
BLAKE2b-256 checksum How to use checksums |
0ed01e8e0f9ad5af82a4d4c9b3056cb793b72c071da4c9d3ed864097395fc8b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_sharing-0.0.2-py2.6.egg
| Download URL | django_sharing-0.0.2-py2.6.egg |
|---|---|
| Size | 15.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
72369267bbacdfbb65a6cb6db3b0fa416644f3a0f0937888b4b2e79851bdfe72
|
|
BLAKE2b-256 checksum How to use checksums |
8568f2e92e62b4ce9a424c1e2a2b85eeb7767975e8076aede1906568dc543862
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_sharing-0.0.2-py2.5.egg
| Download URL | django_sharing-0.0.2-py2.5.egg |
|---|---|
| Size | 15.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
9ecad0856170d862b72cd07ae7ae5559063e84af166928a8953bfadf44debe99
|
|
BLAKE2b-256 checksum How to use checksums |
6305d9cab0d45f79404c459444377e1eeb3d2f9584a90667de060cc35c9cdc07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-sharing 0.0.2
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.