示例#1
0
    def get_context_data(self, **kwargs):
        context = super(ServiceProviderList, self).get_context_data(**kwargs)
        if not settings.ACTIVATE_LDAP:
            context['ldap_providers'] = ServiceProvider.objects.none()
        else:
            providers = get_service_provider_queryset(user=self.request.user,
                                                      service_type='ldap')
            if self.request.user.is_superuser:
                context['ldap_providers'] = providers.order_by(
                    '-modified', '-production', 'entity_id')
            else:
                context['ldap_providers'] = providers

        if not settings.ACTIVATE_OIDC:
            context['oidc_providers'] = ServiceProvider.objects.none()
        else:
            providers = get_service_provider_queryset(user=self.request.user,
                                                      service_type='oidc')
            if self.request.user.is_superuser:
                context['oidc_providers'] = providers.order_by(
                    '-modified', '-production', 'entity_id')
            else:
                context['oidc_providers'] = providers

        context['activate_saml'] = settings.ACTIVATE_SAML
        context['activate_ldap'] = settings.ACTIVATE_LDAP
        context['activate_oidc'] = settings.ACTIVATE_OIDC
        return context
示例#2
0
 def get_queryset(self):
     if not settings.ACTIVATE_SAML:
         return ServiceProvider.objects.none()
     providers = get_service_provider_queryset(user=self.request.user,
                                               service_type='saml')
     if self.request.user.is_superuser:
         return providers.order_by('-modified', '-production', '-test',
                                   'entity_id')
     else:
         return providers
示例#3
0
 def get_queryset(self):
     """
     Restricts the returned information to services
     """
     return get_service_provider_queryset(user=self.request.user, service_type='saml')
示例#4
0
 def get_queryset(self):
     return get_service_provider_queryset(user=self.request.user)
示例#5
0
 def get_queryset(self):
     return get_service_provider_queryset(user=self.request.user,
                                          service_type='oidc')