Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize contributors to view and patch draft documents #98

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

jfreda
Copy link
Contributor

@jfreda jfreda commented Mar 21, 2023

Currently, only doc owners can access a draft document through Hermes even though we share the Google Doc with contributors. This PR allows contributors to view and patch draft documents through Hermes. Delete access is still restricted to document owners.

@jfreda jfreda requested a review from a team as a code owner March 21, 2023 23:32
@@ -540,6 +549,14 @@ func DraftsDocumentHandler(
l.Info("retrieved document draft", "doc_id", docId)

case "DELETE":
// Authorize request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I thought this would already be in place for deleting documents. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were! 🙂 We were only authorizing draft owners for all methods before this PR, and now with this PR we authorize owners+contributors for all methods, and this is extra authorization to only allow owners to delete drafts.

@jfreda jfreda merged commit 2bdc7ec into main Mar 22, 2023
@jfreda jfreda deleted the jfreda/authorize-contributors-for-drafts branch March 22, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants