コード例 #1
0
    def has_object_permission(self, request, view, obj):
        # This means that we allowed this auth backend on this endpoint
        if self._check_internal_or_ephemeral(request=request):
            return True

        return access.has_object_permission(entity=Entities.OWNER,
                                            permission=ClusterPermission,
                                            request=request,
                                            view=view,
                                            obj=obj)
コード例 #2
0
ファイル: node.py プロジェクト: yutiansut/polyaxon
    def has_object_permission(self, request: HttpRequest, view, obj) -> bool:
        # This means that we allowed this auth backend on this endpoint
        if self._check_internal_or_ephemeral(request=request):
            return True

        return access.has_object_permission(resource=Resources.NODE,
                                            permission=NodePermission,
                                            request=request,
                                            view=view,
                                            obj=obj)
コード例 #3
0
ファイル: activitylogs.py プロジェクト: xuduofeng/polyaxon
    def has_object_permission(self, request, view, obj):
        # This means that we allowed this auth backend on this endpoint
        if self._check_internal_or_ephemeral(request=request):
            return True

        return access.has_object_permission(resource=Resources.ACTIVITY_LOG,
                                            permission=ActivityLogPermission,
                                            request=request,
                                            view=view,
                                            obj=obj)
コード例 #4
0
    def has_object_permission(self, request: HttpRequest, view, obj) -> bool:
        if self._check_internal_or_ephemeral(request=request):
            return True

        result = super().has_object_permission(request, view, obj.owner)
        if not result:
            return result

        return access.has_object_permission(resource=Resources.PROJECT,
                                            permission=ProjectPermission,
                                            request=request,
                                            view=view,
                                            obj=obj)