Repository navigation
feat(project-roles): create roles and grant or remove a role for a member (EP-08 #245) - #265
Open
ademboukabes wants to merge 7 commits into
Open
ademboukabes wants to merge 7 commits into
ademboukabes wants to merge 7 commits into
Conversation
ademboukabes
force-pushed
the
feat/ep-08-project-roles
branch
from
November 14, 2026 00:49
db92239 to
c02379b
Compare
ademboukabes
force-pushed
the
feat/ep-08-project-roles
branch
from
November 14, 2026 01:00
c02379b to
e1571a5
Compare
ademboukabes
force-pushed
the
feat/ep-08-project-roles
branch
from
November 14, 2026 01:12
e1571a5 to
f6f1c10
Compare
This branch has not been 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.
Closes #245
What and why
Implements the EP-08 Project API endpoints so the Event Platform can create event roles and grant or remove them for members automatically, under the
manage_rolesscope, with strict anti-escalation and hierarchy protection.Endpoints added:
POST /api/servers/:serverId/roles: creates a Discord role with no permissions (permissions: 0n), derives hierarchy level, stores inroles, and records project ownership inproject_created_roles.PUT /api/servers/:serverId/members/:discordId/roles/:roleId: assigns role to member on Discord, records inserver_member_roles, invalidates permission cache, returns204 No Content(idempotent on repeat).DELETE /api/servers/:serverId/members/:discordId/roles/:roleId: removes role on Discord, deletes fromserver_member_roles, invalidates permission cache, returns204 No Content(idempotent on repeat).Security controls:
MC_EXECUTIVE_ROLE_ID,MC_DEV_LEADS_ROLE_ID,MC_IT_LEADS_ROLE_ID, orisGlobal).actionType: 'access',action: 'role_escalation_attempt', severity'warning').Acceptance criteria
project-roles.service.spec.ts,project-roles.e2e-spec.tsproject-roles.service.spec.ts,project-roles.e2e-spec.tsproject-roles.service.spec.tspermissions: 0n):project-roles.service.spec.ts,project-roles.e2e-spec.tsapps/api/openapi.json,apps/web/src/content/docs/api-reference/project/roles.mdx,apps/cli/src/generated/api.d.tsChecked
pnpm turbo run lint typecheck: 11/11 tasks clean across all packagespnpm turbo run test: all unit and e2e test suites pass (116 suites / 1446 tests in api, 120 suites / 1404 tests in web, 47 suites / 311 tests in cli)pnpm turbo run build: all packages build cleanlypnpm docs:apipnpm --filter mcid-cli generate:api-types0012_pale_pretty_boy.sqlverified idempotent (CREATE TABLE IF NOT EXISTS, guarded foreign keys inDO $$ ... $$)Scope and limit
manage_rolesadded to@mcid/contractsand admin UI pickers (ScopeSelector,ServerAccessMatrix).