update_role
Modify an existing BookStack role by updating its display name, description, external authentication ID, or permission assignments to manage user access control.
Instructions
Update an existing role
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Role ID | |
| display_name | No | Display name for the role | |
| description | No | Role description | |
| external_auth_id | No | External authentication ID | |
| permissions | No | Array of permission names to assign to the role (replaces existing) |
Implementation Reference
- src/tools/search-user-tools.ts:453-459 (handler)Executes the update_role tool: parses role ID from arguments, calls BookStackClient.updateRole, and returns formatted response.case "update_role": { const { id, ...updateData } = args; const roleId = parseInteger(id); const result = await client.updateRole(roleId, updateData); return formatApiResponse(result); }
- Input schema defining parameters for updating a role: id (required), display_name, description, external_auth_id, permissions.inputSchema: { type: "object", properties: { id: { type: "number", description: "Role ID" }, display_name: { type: "string", description: "Display name for the role", }, description: { type: "string", description: "Role description" }, external_auth_id: { type: "string", description: "External authentication ID", }, permissions: { type: "array", description: "Array of permission names to assign to the role (replaces existing)", items: { type: "string" }, }, }, required: ["id"], },
- src/tools/search-user-tools.ts:198-223 (registration)Tool registration in createSearchAndUserTools: defines name, description, and inputSchema for update_role.{ name: "update_role", description: "Update an existing role", inputSchema: { type: "object", properties: { id: { type: "number", description: "Role ID" }, display_name: { type: "string", description: "Display name for the role", }, description: { type: "string", description: "Role description" }, external_auth_id: { type: "string", description: "External authentication ID", }, permissions: { type: "array", description: "Array of permission names to assign to the role (replaces existing)", items: { type: "string" }, }, }, required: ["id"], }, },
- src/index.ts:103-128 (registration)Registration and dispatch logic in main server: includes 'update_role' in searchUserToolNames and routes to handleSearchAndUserTool.const searchUserToolNames = [ "search_all", "list_users", "get_user", "create_user", "update_user", "delete_user", "list_roles", "get_role", "create_role", "update_role", "delete_role", "list_attachments", "get_attachment", "delete_attachment", "list_images", "get_image", "update_image", "delete_image", ]; if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {
- src/lib/bookstack-client.ts:324-329 (helper)BookStackClient helper method that sends PUT request to /roles/{id} to update the role.async updateRole( id: number, data: Partial<CreateRoleRequest> ): Promise<Role> { return this.put<Role>(`/roles/${id}`, data); }