django-acl-permissions 2.0.0

Creator: codyrutscher

Last updated:

Add to Cart

Description:

djangoaclpermissions 2.0.0

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)

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.