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

Remove author from brew / promote author to owner #3341

Open
2 tasks
ericscheid opened this issue Mar 4, 2024 · 3 comments
Open
2 tasks

Remove author from brew / promote author to owner #3341

ericscheid opened this issue Mar 4, 2024 · 3 comments
Assignees
Labels

Comments

@ericscheid
Copy link
Collaborator

ericscheid commented Mar 4, 2024

Your idea:

Issue #1987 limits /edit/:id access to a list of authors, and facilitates adding authors to that list (via an invitedAuthors intermediary step). The resulting PR #2561 does most of what was requested, but deferred on "removal of authors" (implementing edit authorisation was urgent).

This issue repeats the need for a method for two things:

  • removing a co-author from a brew — limited to only authors[0] being permitted to do so
  • promoting a co-author to authors[0] — to hand over control
@ericscheid
Copy link
Collaborator Author

  • We'd need to do a code-review to ensure we don't inadvertently shuffle authors[ ] anywhere else.

@dbolack-ab
Copy link
Collaborator

The only place I have found authors being updated is this section of the updateBrew API call.

		if(req.account) {
			brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
			brew.invitedAuthors = _.uniq(_.filter(brew.invitedAuthors, (a)=>req.account.username !== a));
		}

This looks to be handling when a user comes in on an in invite and saves the first time. This also suggests to me that you only transition from an invitee to an author by saving.

This was by no means, a thorough review.

@5e-Cleric
Copy link
Member

I like this approach, because if done right, its backwards compatible with any of the 700k brews with author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants