Please help us help you and fill where relevant: Your LimeSurvey version: 6.10.2 Own server or LimeSurvey hosting: Own Survey theme/template: Own
==================
A survey can have entries in the plugin_setting table. Such an entry can have a survey ID entered in the `madel_id` column, the `key` column can have the value `is_local`, and the `value` column can have `true`.
I created a local administrator role and assigned this role to a user. I created several surveys. Some surveys have the entries described above in the plugin_settings table.
I need the user with the local administrator role to have access only to surveys defined as `is_local`/`true`.
Of course I want to do this in the plugin, but I don't know how to modify Survey/search/criteria.
Or maybe I should connect somewhere else?
I now have a solution that simulates handling criteria in the plugin, but I would like it to be a plugin, without changing the original code.
class Survey extends LSActiveRecord implements PermissionInterface
{
…
public function search($options = [])
{
…
Yii::import('xxx_survey_search.LocalSurveyAccess', true);
$lsa = new LocalSurveyAccess();
$lsa->beforeSurveySearch($criteria);
class LocalSurveyAccess /*extends PluginBase*/
{
…
public function beforeSurveySearch(& $criteria)
{
…
$criteria->addInCondition('t.sid', array_map('intval', $localSurveys));
I kindly ask for help or advice on how to search for surveys with a custom parameter defined in the plugin_setting table.