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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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