gs-django-authplus


Namegs-django-authplus JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryReusable Django application that provides structured permission grouping
upload_time2025-08-27 11:19:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseCopyright (c) 2025 Sandi Šaban Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords authentication django permissions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gs-django-authplus

Reusable Django application `authplus` provides structured permission grouping.

When having a lot of defined models, managing permissions for users and groups can be quite a challenge. This application allows organizing permissions into permission packages, just like users are organized into groups. This makes it more natural than using groups for everything.

Organizing user groups into subgroups is also provided. User that is a member of a group is also member of all parent groups of that group.

## Installation

If using Astral's uv for virtual environment and project dependencies:

```
$ uv add gs-django-authplus
```

Or, with pip in your virtual environment:

```
$ pip install gs-django-authplus
```


## Quick setup

Add application to `settings.py`:

```
INSTALLED_APPS = [
    ...
    "authplus",
]
```


## Models

### PermissionsPackage

Permissions package is a generic way to categorize permissions.

Permissions packages are used for easier applying a bunch of related permissions to a user or user groups. This can also be achieved using `django.contrib.auth.models.Group`, but it seems more natural to separate permission groups and user groups.

`PermissionPackage` is based on abstract class `AbstractPermissionsPackage` to allow easier extension and customizations.


### UserGroup

User group is a generic way to categorize users.

User groups have a hierarchical structure so each group can have several subgroups. User that is a member of a group is also member of all parent groups of that group.

Permissions for user groups can be granted using individual permissions or permissions packages.

`UserGroup` is based on abstract class `AbstractUserGroup` to allow easier extension and customizations.


### AbstractUserPlus

Abstract class for project user which inherits from class `django.contrib.auth.models.AbstractUser` and allows using `PermissionsPackage` and `UserGroup` for defining permissions granted to user.


### User

Project user based on `AbstractUserPlus`.


## Translations

Package comes with translations to:

- Croatian (hr)

To create translations for new language:

```bash
$ git clone git@gitlab.com:gs-django-authplus.git
$ cd gs-django-authplus
$ uv sync
$ uv run django-admin makemessages -l language_code
# edit django.po file for the new language
$ make compilemessages
# build will also automatically compile messages
$ uv build
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gs-django-authplus",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "authentication, django, permissions",
    "author": null,
    "author_email": "Sandi \u0160aban <sandi.saban@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fd/48/9bff365208fca8359b6e195b28a645250eb2b5d70150e21242107b2cfd25/gs_django_authplus-1.0.0.tar.gz",
    "platform": null,
    "description": "# gs-django-authplus\n\nReusable Django application `authplus` provides structured permission grouping.\n\nWhen having a lot of defined models, managing permissions for users and groups can be quite a challenge. This application allows organizing permissions into permission packages, just like users are organized into groups. This makes it more natural than using groups for everything.\n\nOrganizing user groups into subgroups is also provided. User that is a member of a group is also member of all parent groups of that group.\n\n## Installation\n\nIf using Astral's uv for virtual environment and project dependencies:\n\n```\n$ uv add gs-django-authplus\n```\n\nOr, with pip in your virtual environment:\n\n```\n$ pip install gs-django-authplus\n```\n\n\n## Quick setup\n\nAdd application to `settings.py`:\n\n```\nINSTALLED_APPS = [\n    ...\n    \"authplus\",\n]\n```\n\n\n## Models\n\n### PermissionsPackage\n\nPermissions package is a generic way to categorize permissions.\n\nPermissions packages are used for easier applying a bunch of related permissions to a user or user groups. This can also be achieved using `django.contrib.auth.models.Group`, but it seems more natural to separate permission groups and user groups.\n\n`PermissionPackage` is based on abstract class `AbstractPermissionsPackage` to allow easier extension and customizations.\n\n\n### UserGroup\n\nUser group is a generic way to categorize users.\n\nUser groups have a hierarchical structure so each group can have several subgroups. User that is a member of a group is also member of all parent groups of that group.\n\nPermissions for user groups can be granted using individual permissions or permissions packages.\n\n`UserGroup` is based on abstract class `AbstractUserGroup` to allow easier extension and customizations.\n\n\n### AbstractUserPlus\n\nAbstract class for project user which inherits from class `django.contrib.auth.models.AbstractUser` and allows using `PermissionsPackage` and `UserGroup` for defining permissions granted to user.\n\n\n### User\n\nProject user based on `AbstractUserPlus`.\n\n\n## Translations\n\nPackage comes with translations to:\n\n- Croatian (hr)\n\nTo create translations for new language:\n\n```bash\n$ git clone git@gitlab.com:gs-django-authplus.git\n$ cd gs-django-authplus\n$ uv sync\n$ uv run django-admin makemessages -l language_code\n# edit django.po file for the new language\n$ make compilemessages\n# build will also automatically compile messages\n$ uv build\n```\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2025 Sandi \u0160aban  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Reusable Django application that provides structured permission grouping",
    "version": "1.0.0",
    "project_urls": null,
    "split_keywords": [
        "authentication",
        " django",
        " permissions"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a33cdc41b990f73ecc027ccf05a2ba5e403976777778f1117854787c443cb03e",
                "md5": "9b25525929cedfcbca4322a8810a7b4e",
                "sha256": "8608ebca6eb0dc319aafcd774eea99ef5e112eb3042ff2dbf077d520a64ef28c"
            },
            "downloads": -1,
            "filename": "gs_django_authplus-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9b25525929cedfcbca4322a8810a7b4e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19267,
            "upload_time": "2025-08-27T11:19:09",
            "upload_time_iso_8601": "2025-08-27T11:19:09.856605Z",
            "url": "https://files.pythonhosted.org/packages/a3/3c/dc41b990f73ecc027ccf05a2ba5e403976777778f1117854787c443cb03e/gs_django_authplus-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fd489bff365208fca8359b6e195b28a645250eb2b5d70150e21242107b2cfd25",
                "md5": "2d4659402660e63451c9c9ebc2ecdaa1",
                "sha256": "7f1d8a58441ffd3b0b8b5311dea4e3d5667617680ef89997275aff4fb175d66f"
            },
            "downloads": -1,
            "filename": "gs_django_authplus-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2d4659402660e63451c9c9ebc2ecdaa1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 13187,
            "upload_time": "2025-08-27T11:19:11",
            "upload_time_iso_8601": "2025-08-27T11:19:11.010097Z",
            "url": "https://files.pythonhosted.org/packages/fd/48/9bff365208fca8359b6e195b28a645250eb2b5d70150e21242107b2cfd25/gs_django_authplus-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-27 11:19:11",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gs-django-authplus"
}
        
Elapsed time: 7.66884s