Invite: grant every feature's required permissions (no Administrator)#13
Merged
Conversation
The least-privilege set was missing two permissions the bot actually uses: manage_guild (serializer restores server-level settings -- name, verification level, content filter, AFK timeout) and attach_files (.export sends the backup as a JSON file). Both failed after a fresh invite. Added them to clanklib/permissions.py (the single source of truth); the invite/.setup-audit/manifest value moves 805391380 -> 805424180. auren.json + docs updated; the manifest-vs-code test keeps them in lockstep.
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.
Why
The server-tools bot's invite was too slim: the least-privilege set in
clanklib/permissions.pywas missing two permissions the bot genuinely uses, so those actions failed after a fresh invite.What was missing (mapped to the code that needs it)
manage_guildclanklib/serializer.py:406-420(guild.edit(...))attach_files.exportsends the backup as a JSON file (backup-<id>.json)cogs/importexport.py:42-45Change
manage_guildto the Backups and templates feature andattach_filesto Core inclanklib/permissions.py(the single source of truth that drives the invite link, the.setupaudit, and the manifest).805391380→805424180. Still no Administrator.auren.json,docs/deployment.md, andCHANGELOG.mdupdated to match.Verification
create_role/create_*_channel/create_webhook/guild.edit/ban/discord.File); every call now maps to a granted permission. No emoji/sticker restore, threads, or invites exist, so nothing else is needed.FEATURESunion recomputed to805424180and confirmed equal toauren.json— the existingtest_manifest_permissions_match_requiredkeeps them in lockstep, andtest_invite_requests_minimal_not_administratorstill holds (manage_webhooks/ban_memberspresent, no Administrator).Generated by Claude Code