# Permission panel for Django Debug Toolbar [![Pypi](https://img.shields.io/pypi/v/djdt-permissions)](http://pypi.org/project/djdt-permissions)
![License](https://img.shields.io/pypi/l/djdt-permissions)
![coverage](https://img.shields.io/badge/Coverage-94%25-green)
![Django versions](https://img.shields.io/pypi/djversions/djdt-permissions)
![Python versions](https://img.shields.io/pypi/pyversions/djdt-permissions)
A simple DjDT panel displaying the permissions granted to the current user, how the
current user obtained each one of them (directly or through a group
membership), and the resulting consolidated permissions set.
<img width="500" alt="djdt-permission_capture" src="https://github.com/baudhuina/djdt-permissions/assets/26870372/b936a1a1-b9f7-48c8-a9ee-a9c9f77c6989">
## Installation (on top of Django Debug Toolbar)
First, install `django-debug-toolbar` (instructions
<a href='https://django-debug-toolbar.readthedocs.io/en/latest/installation.html' target='_blank'>here</a>), then:
1. Install permission panel, either with Pip or Poetry:
```
pip install 'git+https://github.com/baudhuina/djdt-permissions.git@1.0.0#egg=djdt_permissions'
```
or complete your project's `pyproject.toml` file with XXX TO BE COMPLETED and run `poetry install` or `poetry update`.
<!---
```
pip install djdt-permissions
```
-->
2. Add `djdt_permission` to `INSTALLED_APPS`, make sure it's below `django.toolbar`:
Please note that just as the Debug Toolbar, this panel is not supposed to be installed if 'DEBUG' is False.
```
if DEBUG == True:
INSTALLED_APPS += [
...
'debug_toolbar',
'djdt_permissions',
...
]
```
3. Register the new panel by adding path `djdt_permissions.panels.PermissionsPanel`
to setting `DEBUG_TOOLBAR_PANELS` (which is entirely conditional to `DEBUG`). The
sequence of the panels defines their order in the toolbar.
```
DEBUG_TOOLBAR_PANELS = [
'djdt_permissions.panels.PermissionsPanel',
'debug_toolbar.panels.history.HistoryPanel',
'debug_toolbar.panels.versions.VersionsPanel',
# ... any other panel.
]
```
4. (optional) If you want the panel to be disabled by default, add its full path
in the `DEBUG_TOOLBAR_CONFIG[DISABLE_PANELS]` set.
```
DEBUG_TOOLBAR_CONFIG = {
"DISABLE_PANELS": {
'djdt_permissions.panels.permissions_panelPermissionsPanel',
# any other panel to disable
},
# other config settings.
]
```
<!--- Currently no migrations
5. Apply migrations:
```
manage.py migrate [--database=<your_database>] [--settings=<your_settings>]
```
-->
## Usage
The Permission Panel is used just as any other panel of the Django Debug Toolbar:
- Open DJdT overlay;
- Enable, disable, consult the panel at will...
## Installing the test project
Would you wish to modify/contribute to this project...
NB: The commands below assume that your
`DJANGO_SETTINGS_MODULE`is not set, and that the settings will be the default value from `manage.py`,
i.e.'test_project/settings`. If it is set to another value, add a `--setings=test_project.settings` option
to all `manage.py` commands.
1. Fork the GIT repo from GitHub. It contains a Django test project.
2. Install dependencies: `poetry install`.
3. Apply migrations: `manage.py migrate`.
4. Run server: `manage.py runserver`.
5. Point your browser at http://localhost:8000.
## Running the tests
Once the test project is installed (see above), run the tests without coverage measurement:
```
manage.py test
```
or with coverage measurement (report will be in `coverage_html/index.html`):
```
coverage run -m manage test [-v2]
```
To run the tests for all supported python and django combinations:
```
tox
```
## Contact me
[alain.baudhuin@skynet.be](mailto:alain.baudhuin@skynet.be)
Raw data
{
"_id": null,
"home_page": "https://github.com/baudhuina/djdt-permissions",
"name": "djdt-permissions",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "Django Debug Toolbar,DJdT,django-toolbar",
"author": "Alain Baudhuin",
"author_email": "alain.baudhuin@skynet.be",
"download_url": "https://files.pythonhosted.org/packages/6b/08/0d3ef2aec8718c081563e8ed81115afa4bd5f1afc7fb7ba1bb4a78560567/djdt_permissions-1.0.2.tar.gz",
"platform": null,
"description": "# Permission panel for Django Debug Toolbar [![Pypi](https://img.shields.io/pypi/v/djdt-permissions)](http://pypi.org/project/djdt-permissions)\n\n![License](https://img.shields.io/pypi/l/djdt-permissions)\n![coverage](https://img.shields.io/badge/Coverage-94%25-green)\n![Django versions](https://img.shields.io/pypi/djversions/djdt-permissions)\n![Python versions](https://img.shields.io/pypi/pyversions/djdt-permissions)\n\nA simple DjDT panel displaying the permissions granted to the current user, how the \ncurrent user obtained each one of them (directly or through a group \nmembership), and the resulting consolidated permissions set.\n\n<img width=\"500\" alt=\"djdt-permission_capture\" src=\"https://github.com/baudhuina/djdt-permissions/assets/26870372/b936a1a1-b9f7-48c8-a9ee-a9c9f77c6989\">\n\n## Installation (on top of Django Debug Toolbar)\n\nFirst, install `django-debug-toolbar` (instructions \n<a href='https://django-debug-toolbar.readthedocs.io/en/latest/installation.html' target='_blank'>here</a>), then:\n\n\n1. Install permission panel, either with Pip or Poetry:\n\n ```\n pip install 'git+https://github.com/baudhuina/djdt-permissions.git@1.0.0#egg=djdt_permissions'\n ```\n or complete your project's `pyproject.toml` file with XXX TO BE COMPLETED and run `poetry install` or `poetry update`.\n\n <!---\n ```\n pip install djdt-permissions\n ```\n -->\n\n2. Add `djdt_permission` to `INSTALLED_APPS`, make sure it's below `django.toolbar`:\n\n Please note that just as the Debug Toolbar, this panel is not supposed to be installed if 'DEBUG' is False.\n\n ```\n if DEBUG == True:\n INSTALLED_APPS += [\n ...\n 'debug_toolbar',\n 'djdt_permissions',\n ...\n ]\n ```\n\n3. Register the new panel by adding path `djdt_permissions.panels.PermissionsPanel` \n to setting `DEBUG_TOOLBAR_PANELS` (which is entirely conditional to `DEBUG`). The \n sequence of the panels defines their order in the toolbar.\n\n ```\n DEBUG_TOOLBAR_PANELS = [\n 'djdt_permissions.panels.PermissionsPanel',\n 'debug_toolbar.panels.history.HistoryPanel',\n 'debug_toolbar.panels.versions.VersionsPanel',\n # ... any other panel.\n ]\n ```\n \n4. (optional) If you want the panel to be disabled by default, add its full path\n in the `DEBUG_TOOLBAR_CONFIG[DISABLE_PANELS]` set.\n\n ```\n DEBUG_TOOLBAR_CONFIG = {\n \"DISABLE_PANELS\": {\n 'djdt_permissions.panels.permissions_panelPermissionsPanel',\n # any other panel to disable\n },\n # other config settings.\n ]\n ```\n\n<!--- Currently no migrations \n 5. Apply migrations:\n\n ```\n manage.py migrate [--database=<your_database>] [--settings=<your_settings>]\n ```\n-->\n## Usage\n\nThe Permission Panel is used just as any other panel of the Django Debug Toolbar:\n- Open DJdT overlay;\n- Enable, disable, consult the panel at will...\n\n\n## Installing the test project\n\nWould you wish to modify/contribute to this project...\n\nNB: The commands below assume that your \n`DJANGO_SETTINGS_MODULE`is not set, and that the settings will be the default value from `manage.py`, \ni.e.'test_project/settings`. If it is set to another value, add a `--setings=test_project.settings` option\nto all `manage.py` commands.\n\n1. Fork the GIT repo from GitHub. It contains a Django test project.\n2. Install dependencies: `poetry install`.\n3. Apply migrations: `manage.py migrate`.\n4. Run server: `manage.py runserver`.\n5. Point your browser at http://localhost:8000.\n\n## Running the tests\n\nOnce the test project is installed (see above), run the tests without coverage measurement:\n\n```\nmanage.py test\n```\n\nor with coverage measurement (report will be in `coverage_html/index.html`):\n\n```\ncoverage run -m manage test [-v2]\n```\n\nTo run the tests for all supported python and django combinations:\n\n```\ntox\n```\n\n## Contact me\n\n[alain.baudhuin@skynet.be](mailto:alain.baudhuin@skynet.be)\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A panel for Django Debug Toolbar (DjDT) to display the current user's permissions.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/baudhuina/djdt-permissions",
"Repository": "https://github.com/baudhuina/djdt-permissions"
},
"split_keywords": [
"django debug toolbar",
"djdt",
"django-toolbar"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cad54afb346775349638a79f2317133530a1413de598e59c63988b37baac4950",
"md5": "874fa9ab6d830adbc4dbe92dae7ab6fe",
"sha256": "8d6cb38126e488d97438f1607cc1dba8c9a224bf07c03193c0a207f4791fa9e9"
},
"downloads": -1,
"filename": "djdt_permissions-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "874fa9ab6d830adbc4dbe92dae7ab6fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 9320,
"upload_time": "2023-08-26T23:00:47",
"upload_time_iso_8601": "2023-08-26T23:00:47.479304Z",
"url": "https://files.pythonhosted.org/packages/ca/d5/4afb346775349638a79f2317133530a1413de598e59c63988b37baac4950/djdt_permissions-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6b080d3ef2aec8718c081563e8ed81115afa4bd5f1afc7fb7ba1bb4a78560567",
"md5": "57608933a500286082f2cd58b1902361",
"sha256": "96f585914856a9c02138894287c405a2d97b6f5945b56192c624a1a169d0aa0a"
},
"downloads": -1,
"filename": "djdt_permissions-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "57608933a500286082f2cd58b1902361",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 9117,
"upload_time": "2023-08-26T23:00:50",
"upload_time_iso_8601": "2023-08-26T23:00:50.122050Z",
"url": "https://files.pythonhosted.org/packages/6b/08/0d3ef2aec8718c081563e8ed81115afa4bd5f1afc7fb7ba1bb4a78560567/djdt_permissions-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-26 23:00:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "baudhuina",
"github_project": "djdt-permissions",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "djdt-permissions"
}