feat(cabana,pier): add Media Library admin API, mediafinder, Mail Images unification, and MCP tools

This commit is contained in:
Jakub Zych
2026-11-27 13:05:22 +01:00
parent 052aac4312
commit 2f0a44e504
32 changed files with 3882 additions and 69 deletions

View File

@@ -11,6 +11,7 @@ import (
"git.golem15.com/golem15/summercms/modules/backpack"
"git.golem15.com/golem15/summercms/modules/bonfire"
"git.golem15.com/golem15/summercms/modules/pact"
"git.golem15.com/golem15/summercms/modules/party"
"git.golem15.com/golem15/summercms/modules/phrasebook"
"gorm.io/gorm"
@@ -99,15 +100,33 @@ permissions it needs. --json prints them as a JSON array.`,
}
func tokenCatalogForApp(app *backpack.App) (*Registry, error) {
if guard := publishedResolverGuard(app); guard != nil && guard.reg != nil && guard.reg.tokenScopes != nil {
return guard.reg, nil
}
plugins := []party.Plugin{}
if app != nil {
if activated, ok := app.Lookup[party.Activated](); ok && activated != nil {
plugins = []party.Plugin(activated)
}
}
if hasAdminControllers(plugins) {
plugins, _ = withBackendScreens(app, plugins)
}
return compileTokenCatalog(plugins)
}
func hasAdminControllers(plugins []party.Plugin) bool {
for _, p := range plugins {
if p == nil {
continue
}
if src, ok := p.(pact.HasAdminControllers); ok && src != nil && len(src.AdminControllers()) > 0 {
return true
}
}
return false
}
func adminTokenCreate(ctx context.Context, app *backpack.App, in bonfire.Input, out bonfire.Output) error {
identifier := argValue(in, "identifier")
if identifier == "" {