Work towards removing is_server_owner#1204
Merged
aaronleopold merged 9 commits intoJun 2, 2026
Merged
Conversation
This consolidates the permission-check logic of this guard to be consistent with `has_permission` and `enforce_permissions`. Also clean up a few tests.
Except for tests, these were now unused.
Wire the remaining missing permissions equivalent to server owner to `ManageServer`. Some of these permissions will likely need to be removed eventually (`AccessKoreaderSync`...), but keeping them now to avoid breaking changes.
This follows the same existing logic that currently grants `is_server_owner`, which will eventually be removed.
Both remaining usages now have an easy alternative granted through `ManageServer`.
This routes the API key validation (which acts on a `LoginUser`) through `has_permission` for consistency with the rest of permissions handling.
It might be worth surfacing some sort of warning in the UI, e.g. when trying to delete the last user with `ManageServer` permission, but given that this permission is something that can be granted to multiple users, I'm not sure it makes sense to just prevent that in the mutation anymore.
Decouple book-club moderation from server owner. Two new permissions: - `ModerateBookClubs`: moderator-tier across all clubs: edit/delete any message, lock/pin/create/archive discussions, see clubs the user isn't a member of - `ManageBookClubs`: admin-tier across all clubs: everything `ModerateBookClubs` grants, plus suggestion administration. `ManageServer` associates to `ManageBookClubs`, so previously owners retain the same behaviour.
aaronleopold
approved these changes
Jun 2, 2026
Collaborator
aaronleopold
left a comment
There was a problem hiding this comment.
This looks great to me!
I'm not using some of the features here (especially book clubs), so would be keen on getting some feedback on whether the permission sets make sense here!
I think what you have is perfectly reasonable 🙂
| let is_updating_server_owner = by_user.is_server_owner && by_user.id == for_user_id; | ||
| if !is_updating_server_owner { | ||
| update_user_age_restriction(&for_user_id, &input.age_restriction, &txn).await?; | ||
| update_user_age_restriction(&for_user_id, &input.age_restriction, &txn).await?; |
Collaborator
There was a problem hiding this comment.
I suppose it's possible for a user to have age restrictions and manage server permissions? I don't personally use age restriction features, and esp not for those I grant admin access lol, so perhaps a non-issue for people who do use it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another batch of work towards removing
is_server_owner. I'm not using some of the features here (especially book clubs), so would be keen on getting some feedback on whether the permission sets make sense here!