mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-12 01:56:25 +01:00
Restructure Alliance Auth package (#867)
* Refactor allianceauth into its own package * Add setup * Add missing default_app_config declarations * Fix timerboard namespacing * Remove obsolete future imports * Remove py2 mock support * Remove six * Add experimental 3.7 support and multiple Dj versions * Remove python_2_unicode_compatible * Add navhelper as local package * Update requirements
This commit is contained in:
22
allianceauth/services/auth_hooks.py
Normal file
22
allianceauth/services/auth_hooks.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from allianceauth import hooks
|
||||
from .hooks import MenuItemHook
|
||||
from .hooks import ServicesHook
|
||||
|
||||
|
||||
class Services(MenuItemHook):
|
||||
def __init__(self):
|
||||
MenuItemHook.__init__(self,
|
||||
'Services',
|
||||
'fa fa-cogs fa-fw grayiconecolor',
|
||||
'auth_services', 100)
|
||||
|
||||
def render(self, request):
|
||||
for svc in ServicesHook.get_services():
|
||||
if svc.service_active_for_user(request.user):
|
||||
return MenuItemHook.render(self, request)
|
||||
return ''
|
||||
|
||||
|
||||
@hooks.register('menu_item_hook')
|
||||
def register_menu():
|
||||
return Services()
|
||||
Reference in New Issue
Block a user