@@ -47,6 +47,7 @@ const (
|
|||||||
ActionGetDocument Action = "getDocument"
|
ActionGetDocument Action = "getDocument"
|
||||||
ActionGetReport Action = "getReport"
|
ActionGetReport Action = "getReport"
|
||||||
ActionGetFile Action = "getFile"
|
ActionGetFile Action = "getFile"
|
||||||
|
ActionGetAudit Action = "getAudit"
|
||||||
ActionGetFileUrl Action = "getFileUrl"
|
ActionGetFileUrl Action = "getFileUrl"
|
||||||
ActionGetFramework Action = "getFramework"
|
ActionGetFramework Action = "getFramework"
|
||||||
ActionGetHorizontalLogoUrl Action = "getHorizontalLogoUrl"
|
ActionGetHorizontalLogoUrl Action = "getHorizontalLogoUrl"
|
||||||
@@ -557,8 +558,9 @@ var Permissions = map[uint16]map[Action][]Role{
|
|||||||
ActionSignatures: NonEmployeeRoles,
|
ActionSignatures: NonEmployeeRoles,
|
||||||
ActionExportDocumentVersionPDF: NonEmployeeRoles,
|
ActionExportDocumentVersionPDF: NonEmployeeRoles,
|
||||||
|
|
||||||
ActionUpdateDocumentVersion: EditRoles,
|
ActionUpdateDocumentVersion: EditRoles,
|
||||||
ActionRequestSignature: EditRoles,
|
ActionRequestSignature: EditRoles,
|
||||||
|
ActionDeleteDraftDocumentVersion: EditRoles,
|
||||||
},
|
},
|
||||||
coredata.DocumentVersionSignatureEntityType: {
|
coredata.DocumentVersionSignatureEntityType: {
|
||||||
ActionGet: NonEmployeeRoles,
|
ActionGet: NonEmployeeRoles,
|
||||||
@@ -619,6 +621,7 @@ var Permissions = map[uint16]map[Action][]Role{
|
|||||||
},
|
},
|
||||||
coredata.ReportEntityType: {
|
coredata.ReportEntityType: {
|
||||||
ActionGet: NonEmployeeRoles,
|
ActionGet: NonEmployeeRoles,
|
||||||
|
ActionGetAudit: NonEmployeeRoles,
|
||||||
ActionGetFile: NonEmployeeRoles,
|
ActionGetFile: NonEmployeeRoles,
|
||||||
ActionGetOrganization: NonEmployeeRoles,
|
ActionGetOrganization: NonEmployeeRoles,
|
||||||
ActionGetSnapshot: NonEmployeeRoles,
|
ActionGetSnapshot: NonEmployeeRoles,
|
||||||
|
|||||||
@@ -5827,6 +5827,8 @@ func (r *reportResolver) DownloadURL(ctx context.Context, obj *types.Report) (*s
|
|||||||
|
|
||||||
// Audit is the resolver for the audit field.
|
// Audit is the resolver for the audit field.
|
||||||
func (r *reportResolver) Audit(ctx context.Context, obj *types.Report) (*types.Audit, error) {
|
func (r *reportResolver) Audit(ctx context.Context, obj *types.Report) (*types.Audit, error) {
|
||||||
|
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetAudit)
|
||||||
|
|
||||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
audit, err := prb.Audits.GetByReportID(ctx, obj.ID)
|
audit, err := prb.Audits.GetByReportID(ctx, obj.ID)
|
||||||
@@ -5834,8 +5836,6 @@ func (r *reportResolver) Audit(ctx context.Context, obj *types.Report) (*types.A
|
|||||||
panic(fmt.Errorf("cannot load audit for report: %w", err))
|
panic(fmt.Errorf("cannot load audit for report: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
r.MustBeAuthorized(ctx, audit.OrganizationID, authz.ActionAudit)
|
|
||||||
|
|
||||||
return types.NewAudit(audit), nil
|
return types.NewAudit(audit), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user