feat: list and show quizzes over MCP for their owner
- quizzes_list_quizzes and quizzes_show_quiz bound to GET /api/v1/quizzes
and /api/v1/quizzes/{slug} behind user.api_token, the per-user
golem15.quizzes.manage throttle, a scope and the access_quizzes permission
- the permission is grantable through pact.HasFrontendPermissions
- owner JSON shapes with solutions in manage_json.go, never used by a
student route
This commit is contained in:
14
mcp.go
Normal file
14
mcp.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package quizzes
|
||||
|
||||
import "git.golem15.com/golem15/summercms/modules/pact"
|
||||
|
||||
var _ pact.HasMCP = (*Plugin)(nil)
|
||||
|
||||
// MCP declares the owner's quiz tools (exposed as quizzes_*). Every tool
|
||||
// lists the golem15.quizzes.access_quizzes permission, so a user whose
|
||||
// groups lack it never lists them, and every route the tools bind checks
|
||||
// it again (D-13). The plugin still requires only golem15.user and names
|
||||
// no OAuth server.
|
||||
func (p *Plugin) MCP() pact.MCP {
|
||||
return pact.MCP{Tools: quizTools()}
|
||||
}
|
||||
Reference in New Issue
Block a user