Skip to main content

Access control list (ACL) provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disc resource.

Project description

Access control list (ACL) provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disc resource.

Use of ACL

Think of a scenario in which a particular user is not a member of group created by you but still you want to give some read or write access, how can you do it without making user a member of group, here comes in picture Access Control Lists, ACL helps us to do this trick.

Quick start

Add “django_acl” to your INSTALLED_APPS setting

INSTALLED_APPS = [
        ...
        'django_acl',
    ]

Apply django-acl-permissions models

python manage.py makemigrations
python manage.py migrate

Add user_groups field in to your User Model

class Users(AbstractBaseUser, PermissionsMixin):
    user_groups = models.ManyToManyField(
        Group,
        verbose_name=_("user_groups"),
        blank=True,
        help_text=_(
            "The groups this user belongs to. A user will get all permissions "
            "granted to each of their groups."
        ),
        related_name="user_set",
        related_query_name="user",
    )

Add has_acl_perms function in to your User Model

def has_acl_perms(self, perm, obj = None):
    return acl_has_perms(self, perm, obj=obj)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-acl-permissions-2.0.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_acl_permissions-2.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file django-acl-permissions-2.0.0.tar.gz.

File metadata

  • Download URL: django-acl-permissions-2.0.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for django-acl-permissions-2.0.0.tar.gz
Algorithm Hash digest
SHA256 70989e453e0b174bc8626183f1b1d5cfb8ae74a67d47e07b22268ece922b78d0
MD5 19dac5eab09d9b354d5e5e6f6fdfcc56
BLAKE2b-256 0cb4e50d57025a24b5d182ac92a3f0efa56316c45fe09015251c33808983a2b9

See more details on using hashes here.

File details

Details for the file django_acl_permissions-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_acl_permissions-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf93bf72a8463c20e75a0be3c58e022b43ea86023fa80b795814d60c17dcc684
MD5 d4d6b3f99f12ee7db1e6d21ae5671a09
BLAKE2b-256 f54cff4c071943ea12c7a90d737b1e847e2d7480421bc9ecf480b4d86fb6674e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page