Ejemplo n.º 1
0
    def get_queryset(self):
        request = self.context["request"]
        queryset = Project.objects.filter(team__deleted=False, deleted=False)
        if not has_full_access_scope(request):
            queryset = queryset.filter(team__in=get_teams(request.user))

        return queryset
Ejemplo n.º 2
0
    def get_queryset(self):
        request = self.context["request"]
        queryset = Team.objects.filter(deleted=False)
        if not has_full_access_scope(request):
            queryset = queryset & get_teams(
                request.user)  # get intersection of querysets

        return queryset
Ejemplo n.º 3
0
    def get_queryset(self):
        request = self.context["request"]
        queryset = SCMPipelineRun.objects.filter(
            application__project__team__deleted=False,
            application__project__deleted=False,
            application__deleted=False,
            deleted=False,
        )
        if not has_full_access_scope(request):
            queryset = queryset.filter(
                application__project__team__in=get_teams(request.user))

        return queryset
Ejemplo n.º 4
0
 def get_user_restricted_queryset(self, queryset):
     user_teams = get_teams(self.request.user)
     return queryset.filter(team__in=user_teams)
Ejemplo n.º 5
0
 def get_user_restricted_queryset(self, queryset):
     return get_teams(self.request.user)
Ejemplo n.º 6
0
 def get_user_restricted_queryset(self, queryset):
     user_teams = get_teams(self.request.user)
     return queryset.filter(application__project__team__in=user_teams)
Ejemplo n.º 7
0
 def get_user_restricted_queryset(self, queryset):
     user_teams = get_teams(self.request.user)
     # Do select distinct because of the many to many relationship
     return queryset.distinct().filter(
         scm_pipeline_runs__application__project__team__in=user_teams)
Ejemplo n.º 8
0
 def get_user_restricted_queryset(self, queryset):
     user_teams = get_teams(self.request.user)
     return queryset.filter(application__project__team__in=user_teams,
                            status=PIPELINE_STATUS_QUEUED,
                            scmrelease__isnull=True)