feat(auth): configurable team lead roles for project and squad management - #43
Merged
Merged
Conversation
…efully - Add translation for discord.app_commands errors (MissingPermissions, BotMissingPermissions, CommandOnCooldown, CheckFailure) - Add cog_app_command_error handler in PmCog to return ephemeral error responses to users - Register fallback on_tree_error handler on DggPmBot.tree - Add tests covering app command error translation, PmCog error handling, and bot tree fallback
This was referenced Sep 24, 2026
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.
Summary of Changes
This PR enables Server Managers to delegate project and squad creation and management capabilities to designated Discord Team Lead roles without requiring full Discord
Manage ServerorAdministratorpermissions.1. Database Schema & Persistence
GuildLeadRoleTable(guild_lead_roleswith composite primary key(guild_id, discord_role_id)).0002_add_guild_lead_roles.py.IGuildLeadRoleRepositoryport andPostgresGuildLeadRoleRepositoryadapter.SqlAlchemyUnitOfWork.2. Domain & Authorization Services
AuthService.can_manage_projects(user, guild_id, guild)andrequire_project_managementto check:manage_guild/administrator).guild_lead_roles.discord.Useror uncached members.add_guild_lead_role,remove_guild_lead_role, andlist_guild_lead_roles.3. Slash Commands & Administration
/pm admin lead-role action:<add|remove|list> role:<@Role>for server managers to configure lead roles./pm project create,role,squad,lead,archive,unarchive,setup_forum,rebuild, and/pm squad createto allow authorized Team Lead roles.4. Interactive Discord UI & Control Hubs
Lead Rolesbutton to/pm menu(PmDashboardView) for server managers, openingLeadRolesAdminViewwith a native DiscordRoleSelectmenu to view, assign, and remove lead roles with 1 click.Create Projectbutton (Row 1) onPmHubViewso authorized Team Leads and Server Managers can initialize projects directly from pinned forum control centers.ProjectMenuView): Standardized button label toCreate Projectand displayed creation/management actions for users with authorized Team Lead roles.PmHubViewandensure_pinned_hub_postto ensureguild_lead_role_repois always active even if views are reconstructed without explicit service passing.5. Documentation & Wiki
docs/wiki/Teams-and-Authorization.mdwith the new hierarchy, authorization matrix, and configuration instructions.docs/wiki/Slash-Commands-Reference.mdwith/pm admin lead-roleand updated subcommand permissions.docs/wiki/Forum-Channels-and-Hubs.mdwith the new button layout and ASCII diagrams.docs/wiki/Workflow-Guide.mdanddocs/wiki/Home.md.Testing & Verification
tests/test_authorization.py,tests/test_menus.py, andtests/test_cogs.py.make check).ruff checkandruff format.make docker-build.