Skip to content

Commit

Permalink
fix(*): add the survey analysis permission
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush8923 committed Sep 7, 2024
1 parent 8f59b63 commit 99d8c8f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,12 @@
'archetypes' => array(
'counsellor' => CAP_ALLOW,
),
)
),
'local/moodle_survey:view-survey-analysis' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'principal' => CAP_ALLOW,
),
),
);
4 changes: 4 additions & 0 deletions fill_survey/survey_analysis.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?php

require_once('../../../config.php');
require_once($CFG->dirroot . '/local/moodle_survey/lib.php');
require_login();
if (!has_capability('local/moodle_survey:view-survey-analysis', \context_system::instance())) {
redirect(new moodle_url('/'));
}
echo $OUTPUT->header();

use core\chart_pie;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

$plugin->component = 'local_moodle_survey';
$plugin->release = '0.1.0';
$plugin->version = 2024071718;
$plugin->version = 2024071719;
$plugin->requires = 2022112800;
$plugin->maturity = MATURITY_ALPHA;

0 comments on commit 99d8c8f

Please sign in to comment.