public static function get_calendar_access_information($courseid = 0) {

        $params = self::validate_parameters(self::get_calendar_access_information_parameters(), ['courseid' => $courseid]);

        if (empty($params['courseid']) || $params['courseid'] == SITEID) {
            $context = \context_system::instance();
        } else {
            $context = \context_course::instance($params['courseid']);
        }

        self::validate_context($context);

        return [
            'canmanageentries' => has_capability('moodle/calendar:manageentries', $context),
            'canmanageownentries' => has_capability('moodle/calendar:manageownentries', $context),
            'canmanagegroupentries' => has_capability('moodle/calendar:managegroupentries', $context),
            'warnings' => [],
        ];
    }
public static function get_calendar_access_information($courseid = 0) {

        $params = self::validate_parameters(self::get_calendar_access_information_parameters(), ['courseid' => $courseid]);

        if (empty($params['courseid']) || $params['courseid'] == SITEID) {
            $context = \context_system::instance();
        } else {
            $context = \context_course::instance($params['courseid']);
        }

        self::validate_context($context);

        return [
            'canmanageentries' => has_capability('moodle/calendar:manageentries', $context),
            'canmanageownentries' => has_capability('moodle/calendar:manageownentries', $context),
            'canmanagegroupentries' => has_capability('moodle/calendar:managegroupentries', $context),
            'warnings' => [],
        ];
    }
public static function get_calendar_access_information ( $ courseid = 0 ) { $ params = self :: validate_parameters ( self :: get_calendar_access_information_parameters ( ) , [ 'courseid' => $ courseid ] ) ; if ( empty ( $ params [ 'courseid' ] ) || $ params [ 'courseid' ] == SITEID ) { $ context = \ context_system :: instance ( ) ; } else { $ context = \ context_course :: instance ( $ params [ 'courseid' ] ) ; } self :: validate_context ( $ context ) ; return [ 'canmanageentries' => has_capability ( 'moodle/calendar:manageentries' , $ context ) , 'canmanageownentries' => has_capability ( 'moodle/calendar:manageownentries' , $ context ) , 'canmanagegroupentries' => has_capability ( 'moodle/calendar:managegroupentries' , $ context ) , 'warnings' => [ ] , ] ; }
Convenience function to retrieve some permissions information for the given course calendar.

@param int $courseid Course to check, empty for site.
@return array The access information
@throws moodle_exception
@since  Moodle 3.7
Convenience function to retrieve some permissions information for the given course calendar .