ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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: shib_login.php:26

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 {
55 $ilUser = $this->user;
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)
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 switch ($permission) {
84 case "read":
85 case "visible":
86 if (!self::_lookupOnline($obj_id) &&
88 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
89 return false;
90 }
91 break;
92 }
93
94 return true;
95 }
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="")
$ref_id
Definition: ltiauth.php:66

References $access, $lng, $rbacsystem, $ref_id, $user, $user_id, 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 118 of file class.ilObjPortfolioTemplateAccess.php.

118 : bool
119 {
120 global $DIC;
121
122 $ilAccess = $DIC->access();
123
124 $t_arr = explode("_", $target);
125
126 if ($t_arr[0] !== "prtt" || ((int) $t_arr[1]) <= 0) {
127 return false;
128 }
129
130 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
131 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
132 return true;
133 }
134 return false;
135 }

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 97 of file class.ilObjPortfolioTemplateAccess.php.

97 : bool
98 {
99 return !self::_isOffline($a_id);
100 }
static _isOffline(int $obj_id)
Type-specific implementation of general status, has to be overwritten if object type does not support...

References ilObjectAccess\_isOffline().

+ Here is the call graph for this function:

◆ _lookupOnlineStatus()

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

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

105 : array
106 {
107 $status = [];
108 foreach ($a_ids as $id) {
109 $status[$id] = !self::_isOffline($id);
110 }
111 return $status;
112 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and ilObjectAccess\_isOffline().

Referenced by ILIAS\Container\Content\Filter\FilterManager\legacyOnlineFilter().

+ Here is the call graph for this function:
+ 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: