Skip to content

Invite: grant every feature's required permissions (no Administrator)#13

Merged
HiLleywyn merged 1 commit into
mainfrom
claude/session-hhdgd
Jun 3, 2026
Merged

Invite: grant every feature's required permissions (no Administrator)#13
HiLleywyn merged 1 commit into
mainfrom
claude/session-hhdgd

Conversation

@HiLleywyn
Copy link
Copy Markdown
Owner

Why

The server-tools bot's invite was too slim: the least-privilege set in clanklib/permissions.py was 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)

Permission Feature Code
manage_guild Restore server-level settings (name, verification level, content filter, AFK timeout) on backup/template restore clanklib/serializer.py:406-420 (guild.edit(...))
attach_files .export sends the backup as a JSON file (backup-<id>.json) cogs/importexport.py:42-45

Change

  • Added manage_guild to the Backups and templates feature and attach_files to Core in clanklib/permissions.py (the single source of truth that drives the invite link, the .setup audit, and the manifest).
  • Manifest/invite value moves 805391380805424180. Still no Administrator.
  • auren.json, docs/deployment.md, and CHANGELOG.md updated to match.

Verification

  • Audited the serializer + cogs (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.
  • FEATURES union recomputed to 805424180 and confirmed equal to auren.json — the existing test_manifest_permissions_match_required keeps them in lockstep, and test_invite_requests_minimal_not_administrator still holds (manage_webhooks/ban_members present, no Administrator).

Generated by Claude Code

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.
@HiLleywyn HiLleywyn merged commit ca9f09c into main Jun 3, 2026
2 checks passed
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.

2 participants