jumpserver/apps/orgs/context_processor.py

16 lines
356 B
Python
Raw Normal View History

2018-07-12 16:00:35 +00:00
# -*- coding: utf-8 -*-
#
from .utils import current_org, get_current_org
2018-07-12 16:00:35 +00:00
from .models import Organization
def org_processor(request):
context = {
'ADMIN_ORGS': Organization.get_user_admin_orgs(request.user),
'CURRENT_ORG': get_current_org(),
'HAS_ORG_PERM': current_org.can_admin_by(request.user),
2018-07-12 16:00:35 +00:00
}
return context