Repository navigation
Support Discord role permissions; grant maintainers external emojis - #247
Merged
Merged
Conversation
Add an optional `permissions` list to a role's Discord config, limited to an allowlist of low-risk permissions, and grant USE_EXTERNAL_EMOJIS to the maintainers role. Existing roles are unaffected: roles without `permissions` produce the same resource inputs as before (the key is omitted, not undefined), and their update path stays a name-only PATCH. For roles that do declare permissions, Pulumi owns only the declared bits and merges them into the live value, so permissions set by hand in Discord are preserved; removing an entry later clears only that bit. Dynamic resources update in place (no diff() means no replaces), so no role is recreated or deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pulumi PreviewClick to expand preview output |
Member
|
LGTM - pulumi preview truncates so the |
PederHP
approved these changes
Nov 11, 2026
PederHP
left a comment
Member
There was a problem hiding this comment.
Verified that permission "262144" is added to discord-role-maintainers in the pulumi preview in the CI.
This branch was previously deployed
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.
Adds an optional
permissionsfield to a role's Discord config and uses it to grant Use External Emoji tomaintainers (synced).Safety for existing roles
permissionsare not touched. Their resource inputs are identical to before (the key is omitted, not set toundefined), so Pulumi sees no change. Even on a rename, their update stays a name-only PATCH.permissions, the provider reads the live permissions and sets the declared bits. Every other bit is kept, including permissions set by hand in Discord. Removing an entry later clears only that bit.diff(), so changed inputs update in place. Roles are never recreated, anddelete()never runs.ADD_REACTIONS,EMBED_LINKS,ATTACH_FILES,USE_EXTERNAL_EMOJISandUSE_EXTERNAL_STICKERScan be granted.validate-configrejects anything else, and a test checks that no administrative or moderation bit is on the list.Reviewers: the preview comment should show exactly one change, an update to
discord-role-maintainersaddingpermissions: "262144". Anything else is unexpected.Notes
Testing
npm test: 87 passed, including new tests for the bitfield, preserving hand-set bits, no-op re-apply, revoke-only-declared, and the allowlist.npm run validate: passes, with the new role-permission check.prettier --check: clean.🤖 Generated with Claude Code