Drop report org checks and noisy comments
Report access loads are already tenant-scoped; reject the extra organization guard. Also remove the PortalAccessRequest doc comment called out in review. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -35,9 +35,6 @@ import (
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
// PortalAccessRequest carries the explicit resource IDs to request access for.
|
||||
// Callers must supply at least one ID across the three slices; nil and empty
|
||||
// both mean "none of that type" (there is no "request all" expansion).
|
||||
type PortalAccessRequest struct {
|
||||
CompliancePortalID gid.GID
|
||||
IdentityID gid.GID
|
||||
|
||||
@@ -1001,13 +1001,6 @@ func (r *mutationResolver) RequestReportAccess(ctx context.Context, input types.
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
// GetAuditByReportFileID is only tenant-scoped, so a report belonging to
|
||||
// another organization in the same tenant would otherwise be reachable.
|
||||
// Reject it as not found before an access row can be written.
|
||||
if audit.OrganizationID != compliancePortal.OrganizationID {
|
||||
return nil, gqlutils.NotFoundf(ctx, "report %q not found", input.ReportID)
|
||||
}
|
||||
|
||||
if audit.CompliancePortalVisibility == coredata.CompliancePortalVisibilityPublic {
|
||||
return nil, gqlutils.Invalidf(
|
||||
ctx,
|
||||
@@ -1156,13 +1149,6 @@ func (r *mutationResolver) RequestAccesses(ctx context.Context, input types.Requ
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
// GetAuditByReportFileID is only tenant-scoped, so a report belonging to
|
||||
// another organization in the same tenant would otherwise be reachable.
|
||||
// Reject it as not found before an access row can be written.
|
||||
if audit.OrganizationID != compliancePortal.OrganizationID {
|
||||
return nil, gqlutils.NotFoundf(ctx, "report %q not found", reportID)
|
||||
}
|
||||
|
||||
if audit.CompliancePortalVisibility == coredata.CompliancePortalVisibilityPublic {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user