Metadata-Version: 2.1
Name: django-acl-permissions
Version: 1.1.0
Summary: 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.
Home-page: https://www.coderflare_py.com/
Author: Coder Flare
Author-email: coderflare.py@gmail.com
License: MIT
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 4.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
License-File: LICENSE.txt

=====
ACL
=====

*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

.. code:: sh

   INSTALLED_APPS = [
           ...
           'django_acl',
       ]

Apply django-acl-permissions models

.. code:: sh

       python manage.py makemigrations
       python manage.py migrate

Add user_groups field in to your User Model

.. code:: sh

       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

.. code:: sh

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


