ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
UploadSecurityFunctionsTrait.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
25trait UploadSecurityFunctionsTrait
26{
27 protected function getAccess(
28 int $ref_id,
29 \ilAccessHandler $access
30 ): bool {
31 if ($ref_id !== null
32 && $access->checkAccess('write', '', $ref_id)) {
33 return true;
34 }
35
36 return false;
37 }
38
39 protected function getAccessFailureResult(
40 string $file_identification_parameter_name,
41 string $file_name,
42 \ilLanguage $language
43 ): HandlerResult {
44 $language->loadLanguageModule('content');
45 return new BasicHandlerResult(
46 $file_identification_parameter_name,
47 HandlerResult::STATUS_FAILED,
48 basename($file_name),
49 $language->txt('cont_no_access')
50 );
51 }
52}
language handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
$ref_id
Definition: ltiauth.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))