From 3eeda3a82a242eb98e4dfd183d0bfaf472332b68 Mon Sep 17 00:00:00 2001 From: shagi Date: Tue, 11 May 2021 16:16:05 +0200 Subject: [PATCH] Make user admin section optional --- gas/gas/config.py | 9 --------- gas/gas/users_config.py | 13 +++++++++++++ readme.md | 8 ++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 gas/gas/users_config.py diff --git a/gas/gas/config.py b/gas/gas/config.py index 6d7f9c9..67dac1c 100644 --- a/gas/gas/config.py +++ b/gas/gas/config.py @@ -7,12 +7,3 @@ site.register_role('staff', _('Users with access to gas control panel.')) site.register_role('admins', _('Users with access to everithing inside control panel.')) site.register_urls('', 'gas.gas.core.urls') - -site.register_urls('users', 'gas.gas.users.urls') -site.register_menu( - name='users', - label=_("Users"), - icon="", - url="gas:user_list", - roles=('admins',), -) diff --git a/gas/gas/users_config.py b/gas/gas/users_config.py new file mode 100644 index 0000000..3f8a7d1 --- /dev/null +++ b/gas/gas/users_config.py @@ -0,0 +1,13 @@ +from django.utils.translation import gettext_lazy as _ + +from gas.sites import site + + +site.register_urls('users', 'gas.gas.users.urls') +site.register_menu( + name='users', + label=_("Users"), + icon="", + url="gas:user_list", + roles=('admins',), +) diff --git a/readme.md b/readme.md index 83f2741..b766338 100644 --- a/readme.md +++ b/readme.md @@ -56,6 +56,14 @@ Create a submodule `gas.config` in your django app. Edit this `config.py` file to register your code into `gas`. For examples look at `gas.gas.config` and `gas.gas.users` modules. +Gas comes with a basic user management. To enable this section, import +`gas.gas.users_config` from any `gas.config` of your installed apps. + +To enable the urls but keep the section out of the menu, just add this to +your `gas.config`: + + site.register_urls('users', 'gas.gas.users.urls') + Licenses --------