$db =
$this->
Application()->
Container()->
get('db'
);
$resourceId =
$db->
fetchOne( "SELECT id FROM s_core_acl_resources WHERE name = 'widgets'"
);
if (!
$resourceId) { return $result;
} foreach ($plugin->
getWidgets() as $widget) { $name =
$widget->
getName();
$db->
insert('s_core_acl_privileges',
[ 'name' =>
$name,
'resourceID' =>
$resourceId,
]);
} return $result;
} /**
* Registers a plugin in the collection.
* If $removeData is set to false the plugin data will not be removed.
*
* @param bool $removeData
*
* @throws Exception
*
* @return bool|array
*/