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
Built Distribution
Hashes for django-acl-permissions-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44482563c91944191883489beb0a436c74e86ad6cc29585fd8c50bf4d4dc2191 |
|
MD5 | b085b96320a6e2fedc71691da24f36af |
|
BLAKE2b-256 | 761e3b9d032db7e8370fbf83d669d45853931e9a42457c566578fccbc60b2d63 |
Hashes for django_acl_permissions-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 085ae03fe68ba452084e8a0837e16904dd4a32fd0ece06b4cc61642ccc0f91ab |
|
MD5 | 16525ea59fb9aefd861182848d7b7986 |
|
BLAKE2b-256 | 14bfe8147f9b11a29a59a53bc2616958acee3c99888dbf7de9bd4e9cab426e2e |