Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
16459Bug reportsPluginspublic2020-11-21 12:45
ReporterDenisChenu Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version3.22.25 
Summary16459: Add a way to extend Survey list in administration (for Permission)
Description

Permission can give rights on Survey , but there are no way to extend Surey listing

Steps To Reproduce

Try to create a plugin for admin user with Permission/See on ALL activated survey.

Try to add all activated survey in survey list

Additional Information

Unzure on the good way to do

$coreCriteria = null;
if (!Permission::model()->hasGlobalPermission("surveys", 'read')) {
    $coreCriteria = new CDbCriteria;
    $coreCriteria->mergeWith(array(
        'join'=>"LEFT JOIN {{permissions}} AS permissions ON (permissions.entity_id = t.sid AND permissions.permission='survey' AND permissions.entity='survey' AND permissions.uid='".Yii::app()->user->id."') ",
    ));
    $coreCrite````ria->compare('t.owner_id', Yii::app()->user->id, false);
}
$event = new PluginEvent('searchSurvey');
$event->set('criteria', $coreCriteria);

$oNewCriteria = $event->get('criteria');
if($oNewCriteria) {
    $criteria->mergeWith($oNewCriteria, 'AND');
}
TagsNo tags attached.
Complete LimeSurvey version number (& build)3.22.25
I will donate to the project if issue is resolvedNo
Sync to Zoho Project
Browsernot relevant
Database & DB-Versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Relationships

child of 16440 testingcdorin Feature requests Survey group Permission : minimal system 

Activities

DenisChenu

DenisChenu

2020-07-06 15:34

developer   ~58723

https://bin.shnoulle.net/?53d556e684a88560#YVekRM3yTVHLwC816Qr7MGB9HJCc8pUEsVjLDbT1YaM without encoding

DenisChenu

DenisChenu

2020-11-17 17:30

developer   ~60683

Since have added getPermissionCriteria in Surveys and in SurveyGroups : https://github.com/LimeSurvey/LimeSurvey/pull/1632
I wait for merging this one to add a global event.

DenisChenu

DenisChenu

2020-11-21 12:45

developer   ~60729

Allow append or set :)

$event = new PluginEvent('searchSurvey');
$event->set('criteria', $coreCriteria);
App()->getPluginManager()->dispatchEvent($event);

$finalCriteria = $event->get('criteria');
$aNewCriterias = $event->get('newCriteria');

if(!empty($aNewCriterias)) {
    foreach($aNewCriterias as $newCriteria) {
        $finalCriteria->mergeWith(
            $newCriteria['criteria'],
            $newCriteria['operator'],
        );
    }
}

@gabrieljenik : did you think this event can be intersting ?

Issue History

Date Modified Username Field Change
2020-07-06 15:33 DenisChenu New Issue
2020-07-06 15:34 DenisChenu Note Added: 58723
2020-07-08 11:01 DenisChenu Relationship added related to 16440
2020-11-17 17:30 DenisChenu Note Added: 60683
2020-11-21 12:37 DenisChenu Relationship replaced child of 16440
2020-11-21 12:45 DenisChenu Note Added: 60729