Make user admin section optional

This commit is contained in:
Ales (Shagi) Zabala Alava 2021-05-11 16:16:05 +02:00
parent ab1a600c9e
commit 3eeda3a82a
3 changed files with 21 additions and 9 deletions

View File

@ -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_role('admins', _('Users with access to everithing inside control panel.'))
site.register_urls('', 'gas.gas.core.urls') 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',),
)

13
gas/gas/users_config.py Normal file
View File

@ -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',),
)

View File

@ -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 Edit this `config.py` file to register your code into `gas`. For examples look
at `gas.gas.config` and `gas.gas.users` modules. 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 Licenses
-------- --------