ILIAS  release_8 Revision v8.24
ilObjPortfolioTemplateAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjPortfolioTemplateAccess:
+ Collaboration diagram for ilObjPortfolioTemplateAccess:

Public Member Functions

 __construct ()
 
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _lookupOnline (int $a_id)
 
static _lookupOnlineStatus (array $a_ids)
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Protected Attributes

ilObjUser $user
 
ilLanguage $lng
 
ilRbacSystem $rbacsystem
 
ilAccessHandler $access
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjPortfolioTemplateAccess

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 23 of file class.ilObjPortfolioTemplateAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioTemplateAccess::__construct ( )

Definition at line 30 of file class.ilObjPortfolioTemplateAccess.php.

31 {
32 global $DIC;
33
34 $this->user = $DIC->user();
35 $this->lng = $DIC->language();
36 $this->rbacsystem = $DIC->rbac()->system();
37 $this->access = $DIC->access();
38 }
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjPortfolioTemplateAccess::_checkAccess ( string  $cmd,
string  $permission,
int  $ref_id,
int  $obj_id,
?int  $user_id = null 
)

Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Reimplemented from ilObjectAccess.

Definition at line 53 of file class.ilObjPortfolioTemplateAccess.php.

53 : bool
54 {
58 $ilAccess = $this->access;
59
60 if (is_null($user_id)) {
61 $user_id = $ilUser->getId();
62 }
63
64 switch ($cmd) {
65 case "view":
66 if (!self::_lookupOnline($obj_id)
67 && !$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id)) {
68 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
69 return false;
70 }
71 break;
72
73 // for permission query feature
74 case "infoScreen":
75 if (!self::_lookupOnline($obj_id)) {
76 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
77 } else {
78 $ilAccess->addInfoItem(ilAccessInfo::IL_STATUS_MESSAGE, $lng->txt("online"));
79 }
80 break;
81
82 }
83
84 switch ($permission) {
85 case "read":
86 case "visible":
87 if (!self::_lookupOnline($obj_id) &&
88 (!$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id))) {
89 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
90 return false;
91 }
92 break;
93 }
94
95 return true;
96 }
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...
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
$ilUser
Definition: imgupload.php:34
$ref_id
Definition: ltiauth.php:67

References $access, $ilUser, $lng, $rbacsystem, $ref_id, $user, ilRbacSystem\checkAccessOfUser(), ilAccessInfo\IL_NO_OBJECT_ACCESS, ilAccessInfo\IL_STATUS_MESSAGE, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjPortfolioTemplateAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 126 of file class.ilObjPortfolioTemplateAccess.php.

126 : bool
127 {
128 global $DIC;
129
130 $ilAccess = $DIC->access();
131
132 $t_arr = explode("_", $target);
133
134 if ($t_arr[0] !== "prtt" || ((int) $t_arr[1]) <= 0) {
135 return false;
136 }
137
138 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
139 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
140 return true;
141 }
142 return false;
143 }

References $DIC.

◆ _getCommands()

static ilObjPortfolioTemplateAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Returns
array{permission?:string, cmd?:string, lang_var?:string, default?:bool}[]

Reimplemented from ilObjectAccess.

Definition at line 40 of file class.ilObjPortfolioTemplateAccess.php.

40 : array
41 {
42 $commands = array(
43 array("permission" => "read", "cmd" => "preview", "lang_var" => "preview", "default" => true),
44 array("permission" => "write", "cmd" => "view", "lang_var" => "edit_content"),
45 array("permission" => "write", "cmd" => "edit", "lang_var" => "settings"),
46 array("permission" => "read", "cmd" => "createfromtemplate", "lang_var" => "prtf_create_portfolio_from_template"),
47 // array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
48 );
49
50 return $commands;
51 }

Referenced by ilObjPortfolioTemplateListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjPortfolioTemplateAccess::_lookupOnline ( int  $a_id)
static

Definition at line 98 of file class.ilObjPortfolioTemplateAccess.php.

98 : bool
99 {
101 }
static lookupOnline(int $a_id)

References ilObjPortfolioBase\lookupOnline().

Referenced by ilObjPortfolioTemplateListGUI\getProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupOnlineStatus()

static ilObjPortfolioTemplateAccess::_lookupOnlineStatus ( array  $a_ids)
static
Deprecated:

Definition at line 106 of file class.ilObjPortfolioTemplateAccess.php.

106 : array
107 {
108 global $DIC;
109
110 $ilDB = $DIC->database();
111
112 $q = "SELECT id, is_online FROM usr_portfolio WHERE " .
113 $ilDB->in("id", $a_ids, false, "integer");
114 $lm_set = $ilDB->query($q);
115 $status = [];
116 while ($r = $ilDB->fetchAssoc($lm_set)) {
117 $status[$r["id"]] = $r["is_online"];
118 }
119 return $status;
120 }
$lm_set

References $DIC, $ilDB, and $lm_set.

Referenced by ilContainer\legacyOnlineFilter().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjPortfolioTemplateAccess::$access
protected

Definition at line 28 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().

◆ $lng

ilLanguage ilObjPortfolioTemplateAccess::$lng
protected

Definition at line 26 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().

◆ $rbacsystem

ilRbacSystem ilObjPortfolioTemplateAccess::$rbacsystem
protected

Definition at line 27 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().

◆ $user

ilObjUser ilObjPortfolioTemplateAccess::$user
protected

Definition at line 25 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().


The documentation for this class was generated from the following file: