ITI / searcch

SEARCCH Hub Frontend
https://searcch.cyberexperimentation.org/
BSD 3-Clause "New" or "Revised" License
3 stars 6 forks source link

Alternate Edit Workflow results in "insufficient permission" #153

Closed lauratinnel closed 1 year ago

lauratinnel commented 1 year ago

Cannot edit artifact by clicking EDIT from the My Artifacts list. SAVE and PUBLISH buttons are displayed, but when you click save, you get "insufficient permission to modify artifact".

This is a distinctly different workflow from first clicking "READ MORE" and then clicking "EDIT NEW VERSION", which also includes a "DELETE DRAFT" button.

The best and quickest fix is, I believe, to remove the EDIT button from the My Artifacts list and force a user to view the record before editing. This seems reasonable.

carboxylman commented 1 year ago

@lauratinnel I believe I fixed this; can you please verify?

lauratinnel commented 1 year ago

Is this pushed to the dev hub?

lauratinnel commented 1 year ago

In hub-dev, I tried the above workflow and now I get a different error:

An error occurred
Request failed with status code 403
Forbidden

"{\n    \"message\": \"artifact already published; cannot modify\"\n}\n"

Start over
ckouder commented 1 year ago

which artifact is causing the error? I can't see the error on my end

carboxylman commented 1 year ago

Just import any artifact, publish it, go to/refresh My Artifacts, and there will be an EDIT button even if not in admin mode. But then you click SAVE on the edit page, and you get an error. The EDIT button should only be displayed if the artifact is a draft or if user is admin.

ckouder commented 1 year ago

@carboxylman thank you David! Finally get the bug displayed. I didn't reproduce the bug because I forget to publish the artifact... so when click edit, it takes me to the newest saved draft instead of the published one...