MCPcopy
hub / github.com/gotify/server / requirePluginEnabled

Function requirePluginEnabled

plugin/pluginenabled.go:9–20  ·  view source on GitHub ↗
(id uint, db Database)

Source from the content-addressed store, hash-verified

7)
8
9func requirePluginEnabled(id uint, db Database) gin.HandlerFunc {
10 return func(c *gin.Context) {
11 conf, err := db.GetPluginConfByID(id)
12 if err != nil {
13 c.AbortWithError(500, err)
14 return
15 }
16 if conf == nil || !conf.Enabled {
17 c.AbortWithError(400, errors.New("plugin is disabled"))
18 }
19 }
20}

Callers 2

TestRequirePluginEnabledFunction · 0.85

Calls 1

GetPluginConfByIDMethod · 0.65

Tested by 1

TestRequirePluginEnabledFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…