move load restrictions

This commit is contained in:
Jeffrey Regan
2019-11-01 17:20:50 -07:00
committed by jregan
parent 79c5f8a977
commit a45eca7e22
18 changed files with 243 additions and 139 deletions

View File

@@ -114,10 +114,10 @@ func (l *Loader) loadAndConfigurePlugin(
// function (see "pluginator"). Being able to do this
// is what makes a plugin "builtin".
c, err = l.makeBuiltinPlugin(res.GetGvk())
} else if l.pc.Enabled {
} else if l.pc.PluginRestrictions == types.PluginRestrictionsNone {
c, err = l.loadPlugin(res.OrgId())
} else {
err = pgmconfig.NotEnabledErr(res.OrgId().Kind)
err = types.NewErrOnlyBuiltinPluginsAllowed(res.OrgId().Kind)
}
if err != nil {
return nil, err