Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add account suspension features #174
This renders all requests for that user's posts, collections and related
While suspended, users may not create or edit posts or collections. A 403
User status is listed in the admin user page
Admin view of user details shows status and has a button to activate or
This renders all requests for that user's posts, collections and related ActivityPub endpoints with 404 responses. While suspended, users may not create or edit posts or collections. User status is listed in the admin user page Admin view of user details shows status and now has a button to activate or suspend a user.
thebaer left a comment
Looking pretty good overall -- just combed through everything, reading only. One major design change I'd suggest is creating something like an integer
I'd look at the
Of course, e.g.
- update error messages to be correct - move suspended message into template and include for other pages - check suspended status on all relevant pages and show message if logged in user is suspended. - fix possible nil pointer error - remove changes to db schema files - add version comment to migration - add UserStatus type with UserActive and UserSuspended - change database table to use status column instead of suspended - update toggle suspended handler to be toggle status in prep for possible future inclusion of further user statuses
This adds a User.IsSuspended() method and uses it when displaying the user's status on admin pages, instead of doing a magic number check. This should also help in the future, in case this logic ever changes. Ref T661
The link here is a little redundant, and might make people think that it actually changes the status by clicking on it.
This also includes a bit of explanation about what suspending a user actually does. Ref T661
This puts the verbiage more in line with what the feature does, and leaves room for other moderation controls in the future. NOTE: this includes no backend refactoring, which may be confusing. We should rename things to fit ASAP. Ref T661
Made a few changes to the language, including renaming this function from Suspending a user to Silencing them. This more closely fits the function, leaves room for other kinds of moderation controls, and fits expectations admins should have with other platforms.
Since I'm going to be merging this relatively soon in order to get the release wrapped up, I'm going to note that this is experimental, and solicit bug reports and user feedback.
Some work still to do: