From e68d78bcb75f5479227b685d480e5016a0eff087 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 27 Nov 2024 17:27:40 -0800 Subject: [PATCH] notes about permissions --- pkg/service/submissions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/service/submissions.go b/pkg/service/submissions.go index 5f45cbc..42cd8af 100644 --- a/pkg/service/submissions.go +++ b/pkg/service/submissions.go @@ -105,6 +105,7 @@ func (svc *Service) ListSubmissions(ctx context.Context, request api.ListSubmiss // // PATCH /submissions/{SubmissionID}/completed func (svc *Service) PatchSubmissionCompleted(ctx context.Context, params api.PatchSubmissionCompletedParams) error { + // check if caller has MaptestGame role (request must originate from a maptest roblox game) pmap := datastore.Optional() pmap.Add("completed", true) err := svc.DB.Submissions().Update(ctx, params.SubmissionID, pmap) @@ -117,6 +118,9 @@ func (svc *Service) PatchSubmissionCompleted(ctx context.Context, params api.Pat // // PATCH /submissions/{SubmissionID}/model func (svc *Service) PatchSubmissionModel(ctx context.Context, params api.PatchSubmissionModelParams) error { + // check if caller has Submitter role + // check if Status is ChangesRequested|Submitted|UnderConstruction + // PROBLEM how to deal with async? data may become out of date pmap := datastore.Optional() pmap.AddNotNil("asset_id", params.ModelID) pmap.AddNotNil("asset_version", params.VersionID)