def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['INSTRUCTIONS_URL'] = settings.RESPA_ADMIN_INSTRUCTIONS_URL context['SUPPORT_EMAIL'] = settings.RESPA_ADMIN_SUPPORT_EMAIL if settings.RESPA_ADMIN_LOGO: context['logo_url'] = staticfiles_storage.url( 'respa_admin/img/{0}'.format(settings.RESPA_ADMIN_LOGO)) context['KORO_STYLE'] = settings.RESPA_ADMIN_KORO_STYLE context['user_is_any_admin'] = is_any_admin(self.request.user) return context
def dispatch(self, request, *args, **kwargs): if not is_any_admin(request.user): raise Http404 return super().dispatch(request, *args, **kwargs)
def can_search_users(user): return is_any_admin(user)
def can_access_permissions_view(user): return is_any_admin(user)