blob: 97b64030ad60e1aa82d8a7110eb4651ed984aa8a [file] [log] [blame]
from custos_portal.app_config import CustosAppConfig
class AdminConfig(CustosAppConfig):
name = 'custos_portal.apps.admin'
label = 'custos_portal_admin'
verbose_name = 'Admin'
app_order = 100
url_home = 'custos_portal_admin:list_requests'
fa_icon_class = 'fa-cog'
app_description = """
Configure and share resources with other users.
"""
nav = [
{
'label': 'Create new tenant request',
'icon': 'fa fa-plus-square',
'url': 'custos_portal_admin:request_new_tenant',
'active_prefixes': ['applications', 'request-new-tenant'],
'enabled': lambda req: (req.is_gateway_admin or
req.is_read_only_gateway_admin),
},
{
'label': 'List of all existing tenant requests',
'icon': 'fa fa-list',
'url': 'custos_portal_admin:list_requests',
'active_prefixes': ['applications', 'list-requests'],
'enabled': lambda req: (req.is_gateway_admin or
req.is_read_only_gateway_admin),
}
]
def app_enabled(self, request):
if hasattr(request, "is_gateway_admin") and request.is_gateway_admin:
return True
else:
return False