You can use boolean logic (e.g. AND/OR/NOT) for complex search queries. For more help and examples, see the search documentation.
Search by package name:
my-package
(implicit)
name:my-package
(explicit)
Search by package filename:
my-package.ext
(implicit)
filename:my-package.ext
(explicit)
Search by package tag:
latest
(implicit)
tag:latest
(explicit)
Search by package version:
1.0.0
(implicit)
version:1.0.0
(explicit)
prerelease:true
(prereleases)
prerelease:false
(no prereleases)
Search by package architecture:
architecture:x86_64
Search by package distribution:
distribution:el
Search by package license:
license:MIT
Search by package format:
format:deb
Search by package status:
status:in_progress
Search by package file checksum:
checksum:5afba
Search by package security status:
severity:critical
Search by package vulnerabilities:
vulnerabilities:>1
vulnerabilities:<1000
Search by # of package downloads:
downloads:>8
downloads:<100
Search by package type:
type:binary
type:source
Search by package size (bytes):
size:>50000
size:<10000
Search by dependency name/version:
dependency:log4j
dependency:log4j=1.0.0
dependency:log4j>1.0.0
Search by uploaded date:
uploaded:>"1 day ago"
uploaded:<"August 14, 2022 EST"
Search by entitlement token (identifier):
entitlement:3lKPVJPosCsY
Search by policy violation:
policy_violated:true
deny_policy_violated:true
license_policy_violated:true
vulnerability_policy_violated:true
Search by repository:
repository:repo-name
Search queries for all Debian-specific (and related) package types
Search by component:
deb_component:unstable
Search queries for all Maven-specific (and related) package types
Search by group ID:
maven_group_id:org.apache
Search queries for all Docker-specific (and related) package types
Search by image digest:
docker_image_digest:sha256:7c5..6d4
(full hashref only)
Search by layer digest:
docker_layer_digest:sha256:4c4..ae4
(full hashref only)
Field type modifiers (depending on the type, you can influence behaviour)
For all queries, you can use:
~foo
for negation
For string queries, you can use:
^foo
to anchor to start of term
foo$
to anchor to end of term
foo*bar
for fuzzy matching
For number/date or version queries, you can use:
>foo
for values greater than
>=foo
for values greater / equal
<foo
for values less than
<=foo
for values less / equal
Need a secure and centralised artifact repository to deliver Alpine,
Cargo,
CocoaPods,
Composer,
Conan,
Conda,
CRAN,
Dart,
Debian,
Docker,
Go,
Helm,
Hex,
LuaRocks,
Maven,
npm,
NuGet,
P2,
Python,
RedHat,
Ruby,
Swift,
Terraform,
Vagrant,
Raw & More packages?
Cloudsmith is the new standard in Package / Artifact Management and Software Distribution.
With support for all major package formats, you can trust us to manage your software supply chain.
django-guardian 1.4.9
One-liner (summary)
Description
django-guardian
django-guardian is an implementation of per object permissions [1] on top of Django's authorization backend
Documentation
Online documentation is available at https://django-guardian.readthedocs.io/.
Requirements
- Python 2.7 or 3.4+
- A supported version of Django (currently 1.8+)
Travis CI tests on Django version 1.8, 1.10, and 1.11.
Installation
To install django-guardian simply run:
pip install django-guardian
Configuration
We need to hook django-guardian into our project.
- Put guardian into your INSTALLED_APPS at settings module:
INSTALLED_APPS = ( ... 'guardian', )
- Add extra authorization backend to your settings.py:
AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', # default 'guardian.backends.ObjectPermissionBackend', )
Create guardian database tables by running:
python manage.py migrate
Usage
After installation and project hooks we can finally use object permissions with Django.
Lets start really quickly:
>>> from django.contrib.auth.models import User, Group >>> jack = User.objects.create_user('jack', 'jack@example.com', 'topsecretagentjack') >>> admins = Group.objects.create(name='admins') >>> jack.has_perm('change_group', admins) False >>> from guardian.models import UserObjectPermission >>> UserObjectPermission.objects.assign_perm('change_group', jack, obj=admins) <UserObjectPermission: admins | jack | change_group> >>> jack.has_perm('change_group', admins) True
Of course our agent jack here would not be able to change_group globally:
>>> jack.has_perm('change_group') False
Admin integration
Replace admin.ModelAdmin with GuardedModelAdmin for those models which should have object permissions support within admin panel.
For example:
from django.contrib import admin from myapp.models import Author from guardian.admin import GuardedModelAdmin # Old way: #class AuthorAdmin(admin.ModelAdmin): # pass # With object permissions support class AuthorAdmin(GuardedModelAdmin): pass admin.site.register(Author, AuthorAdmin)
[1] | Great paper about this feature is available at djangoadvent articles. |
Status | Completed |
---|---|
Checksum (MD5) | 4842f1d4b86562af7c48d8fd8be54e75 |
Checksum (SHA-1) | 19b0b83ce864d64b3520914b92ae790b76147afb |
Checksum (SHA-256) | 8836ac9263c9bd8c162efa5fbd0729f7f8ef83008c8da298e8e2aa81ea624c47 |
Checksum (SHA-512) | a2f5ab15de7597a8becf98298691eee1b9b06e836bde8a2524200350073ce621df… |
GPG Signature | |
Storage Region | Dublin, Ireland |
Type | Binary (contains binaries and binary artifacts) |
Uploaded At | 7 years, 4 months ago |
Uploaded By | |
Slug Id | django_guardian-149-py2py3-none-anywhl |
Unique Id | oBoVRW5ZoJok |
Version (Raw) | 1.4.9 |
Version (Parsed) |
|
extended metadata | |
Author | Lukasz Balcerzak <lukaszbalcerzak@gmail.com> |
Classifiers | Development Status :: 5 - Production/Stable | Environment :: Web Environment | Framework :: Django | Framework :: Django :: 1.10 | Framework :: Django :: 1.11 | Framework :: Django :: 1.8 | Framework :: Django :: 1.9 | Intended Audience :: Developers | License :: OSI Approved :: BSD License | Operating System :: OS Independent | Programming Language :: Python | Programming Language :: Python :: 2.7 | Programming Language :: Python :: 3.4 | Programming Language :: Python :: 3.5 | Programming Language :: Python :: 3.6 | Topic :: Security |
Download URL | https://github.com/django-guardian/django-guardian/tags |
Homepage URL | http://github.com/django-guardian/django-guardian |
Metadata Version | 2.0 |
Py Filetype | bdist_wheel |
Py Version | py2.py3 |
pkg | django_guardian-1.4.9-py2.py3-n… |
311
93.7 KB |
md5 | sha1 | sha256 | sha512 |
This package has 117 files/directories.
django-guardian |
311 |
Last scanned
4 days, 2 hours ago
Scan result
Clean
Vulnerability count
0
Max. severity
UnknownYou can embed a badge in another website that shows this or the latest version of this package.
To embed the badge for this specific package version, use the following:
[![This version of 'django-guardian' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true)](https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/)
|This version of 'django-guardian' @ Cloudsmith|
.. |This version of 'django-guardian' @ Cloudsmith| image:: https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true
:target: https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/
image::https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true[link="https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/",title="This version of 'django-guardian' @ Cloudsmith"]
<a href="https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/"><img src="https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/1.4.9/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true" alt="This version of 'django-guardian' @ Cloudsmith" /></a>
rendered as:
To embed the badge for the latest package version, use the following:
[![Latest version of 'django-guardian' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true&show_latest=true)](https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/)
|Latest version of 'django-guardian' @ Cloudsmith|
.. |Latest version of 'django-guardian' @ Cloudsmith| image:: https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true&show_latest=true
:target: https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/
image::https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true&show_latest=true[link="https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/",title="Latest version of 'django-guardian' @ Cloudsmith"]
<a href="https://cloudsmith.io/~cloudsmith/repos/love-open-source/packages/detail/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/"><img src="https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/love-open-source/python/django-guardian/latest/a=noarch;xf=bdist_wheel;xn=django-guardian;xv=py2.py3/?render=true&show_latest=true" alt="Latest version of 'django-guardian' @ Cloudsmith" /></a>
rendered as:
These instructions assume you have setup the repository first (or read it).
To install/use django-guardian @ version 1.4.9 ...
pip install 'django-guardian==1.4.9'
You can also install the latest version of this package:
pip install --upgrade 'django-guardian'
If necessary, you can specify the repository directly:
pip install \
--index-url=https://dl.cloudsmith.io/public/cloudsmith/love-open-source/python/simple/ \
django-guardian==1.4.9
If you've got a project requirements.txt file, you can specify this as a dependency:
--index-url=https://dl.cloudsmith.io/public/cloudsmith/love-open-source/python/simple/
django-guardian==1.4.9
In addition, you can use this repository as an extra index url. However, please read our documentation on this parameter before using it. For example in a requirements.txt file:
--extra-index-url=https://dl.cloudsmith.io/public/cloudsmith/love-open-source/python/simple/
django-guardian==1.4.9