ppm_role_revoke
Revoke a role assignment by removing a user from their assigned security group. Provide the assignment ID to remove access.
Instructions
Revoke a role assignment; removes the user from the security group.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignment_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:343-347 (handler)The @mcp.tool() decorated function ppm_role_revoke that implements the tool logic: calls action_revoke on ppm.role.assignment and reads back the state.
@mcp.tool() def ppm_role_revoke(assignment_id: int) -> dict[str, Any]: """Revoke a role assignment; removes the user from the security group.""" client().call_action("ppm.role.assignment", "action_revoke", [assignment_id]) return _read_state("ppm.role.assignment", assignment_id, _ROLE_FIELDS) - src/qod_ppm_mcp/server.py:343-344 (registration)The @mcp.tool() decorator registers ppm_role_revoke as an MCP tool on the FastMCP instance 'mcp'.
@mcp.tool() def ppm_role_revoke(assignment_id: int) -> dict[str, Any]: - src/qod_ppm_mcp/server.py:324-324 (schema)The _ROLE_FIELDS list defines the fields read back after the revoke action (name, state, role_id, user_id, project_id, date_from, date_to).
_ROLE_FIELDS = ["name", "state", "role_id", "user_id", "project_id", "date_from", "date_to"] - src/qod_ppm_mcp/server.py:30-34 (helper)The _read_state helper reads and returns the state of a record from Odoo, used by ppm_role_revoke to return the updated assignment.
def _read_state(model: str, rec_id: int, fields: list[str]) -> dict[str, Any]: rows = client().read(model, [rec_id], fields) if not rows: raise ValueError(f"{model} id={rec_id} not found") return rows[0]