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

WIP: isOwner = true if the user is a repo collaborator #16

Merged
merged 20 commits into from
Dec 15, 2023

Conversation

rjwebb
Copy link
Contributor

@rjwebb rjwebb commented Dec 6, 2023

This PR updates the isOwner function on the server to additionally check if the user is a repository collaborator on the proposals repository, i.e. that their entry in the users database has is_repo_collaborator set to true. This means that any endpoint that requires the user to be an owner (which includes administrators from the ADMIN_UIDS env var) can now also be called by repo collaborators.

It also adds a line to the Account page that says whether the user is a repo collaborator:
Screenshot 2023-12-08 at 5 13 27 pm

Other changes:

  • Remove the c.hname filter from the manage conversations page - I don't know how this got in there a6b75ac
  • Fix a bug in the create user endpoint where the code expected the result of queryP to be an object with a rows field 4a62d6c
  • In the conversations endpoint, move the isAdministrator check out of the loop that iterates over the conversations, this only needs to be done once f3cd31a

To do:

QA test all of the moderator behaviours

@rjwebb rjwebb changed the base branch from main to raymond.bob-express December 14, 2023 19:28
rjwebb and others added 3 commits December 14, 2023 20:32
* upgrade to express 4

* upgrade to express 5

* client, server: remove headersJson files, set headers in express middleware

---------

Co-authored-by: Bob Webb <bob.wbb@gmail.com>
@raykyri raykyri marked this pull request as ready for review December 14, 2023 19:55
@raykyri raykyri changed the base branch from raymond.bob-express to main December 15, 2023 00:15
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