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

Create "Moderator" level User and corresponding permissions #4011

Closed
di opened this issue May 16, 2018 · 14 comments
Closed

Create "Moderator" level User and corresponding permissions #4011

di opened this issue May 16, 2018 · 14 comments

Comments

@di
Copy link
Member

di commented May 16, 2018

Currently on PyPI, we have two types of users:

  • regular users
  • administrators (for which User.is_superuser is true)
  • (There is also a field User.is_staff but I believe it's unused).

It'd be great to add an intermediate level of user, "Moderator", which has the ability to do the following:

  • view all the existing /admin views (but read-only)
  • set upload limits
  • add classifiers
  • etc

The "Moderator" user should not be able to:

  • change emails (including verified or active status)
  • delete projects
  • nuke users

(cc @99)

@dstufft
Copy link
Member

dstufft commented May 16, 2018

The User.is_staff field comes from when I was attempting to port Warehouse to Django, and I do believe it is entirely unused.

One thing that might also be useful (although could come at a later time too!) is the ability to do things like request a delete of a project (or a nuke of a user etc), and then have the admins be able to deny or approve that request. That allows them to structurally make recommendations to the admins, and the admins to still have the final say. It also allows us to provide a path towards moderators becoming admins (if they desire) since we can easily look and go "hey, every time this person makes a recommendation we end up following up, maybe we just want to promote them".

@di
Copy link
Member Author

di commented May 16, 2018

Agreed. I think the steps to address this, roughly broken up by PRs, would be:

  • Add a new field/migration to the User model, as well as corresponding UI in /admin for administrators to toggle this flag for users;
  • Add ACLs for various /admin POST endpoints, as well as conditionals in the HTML templates to hide actions that are not enabled for moderators, and to make fields not appear editable;
  • Add back these actions as "request/recommendation" actions that get raised to administrators. This could piggyback on the system we use for User report mechanism for projects that damage other packages, don't adhere to guidelines, or are malicious #3896.

@dstufft
Copy link
Member

dstufft commented May 16, 2018

Yea, that seems like a great path forward.

@crwilcox
Copy link
Contributor

crwilcox commented Jan 4, 2019

I am going to start working on this. I have the first part complete (add new field and migration as well as adding is_moderator as settable in admin UIs) https://github.com/pypa/warehouse/pull/5249/files

@crwilcox
Copy link
Contributor

crwilcox commented Jan 4, 2019

@di @dstufft I am moving on to Add ACLs for various /admin POST endpoints, as well as conditionals in the HTML templates to hide actions that are not enabled for moderators, and to make fields not appear editable;

Do you have a starting list of activities you would like to allow moderators to do? For instance, should moderators be able to mark other users as having a verified email?

@di
Copy link
Member Author

di commented Jan 5, 2019

@crwilcox See the issue body:

view all the existing /admin views (but read-only)
set upload limits
add classifiers

@di
Copy link
Member Author

di commented Jan 25, 2019

#5249 is merged, we can now set users as moderators.

@jamadden @yeraydiazdiaz Would you like to be moderators?

@yeraydiazdiaz
Copy link
Contributor

That’s a yes for me, thanks ☺️

@crwilcox
Copy link
Contributor

@theacodes volunteered if you want additional moderators.

@pradyunsg
Copy link
Contributor

I volunteer too, if you need more eyes and hands on deck. :)

@jamadden
Copy link
Contributor

Yes, please. And thank you.

@jamadden
Copy link
Contributor

@ewdurbin I got your Slack invite, thank you. Would it be possible to switch it to the alternate address for my PyPI account?

@ewdurbin
Copy link
Member

absolutely. will do.

@di
Copy link
Member Author

di commented Mar 25, 2020

Hey, we have moderators now! Closing this.

@di di closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants