ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjPortfolioTemplateAccess Class Reference

Class ilObjPortfolioTemplateAccess. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _lookupOnline ($a_id)
 
static _lookupOnlineStatus ($a_ids)
 Check wether booking pool is online (legacy version) More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Protected Attributes

 $user
 
 $lng
 
 $rbacsystem
 
 $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioTemplateAccess::__construct ( )

Constructor.

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

37 {
38 global $DIC;
39
40 $this->user = $DIC->user();
41 $this->lng = $DIC->language();
42 $this->rbacsystem = $DIC->rbac()->system();
43 $this->access = $DIC->access();
44 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjPortfolioTemplateAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)

Checks wether 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.

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Reimplemented from ilObjectAccess.

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

60 {
64 $ilAccess = $this->access;
65
66 if ($a_user_id == "") {
67 $a_user_id = $ilUser->getId();
68 }
69
70 switch ($a_cmd) {
71 case "view":
72 if (!self::_lookupOnline($a_obj_id)
73 && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
74 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
75 return false;
76 }
77 break;
78
79 // for permission query feature
80 case "infoScreen":
81 if (!self::_lookupOnline($a_obj_id)) {
82 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
83 } else {
84 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
85 }
86 break;
87
88 }
89
90 switch ($a_permission) {
91 case "read":
92 case "visible":
93 if (!self::_lookupOnline($a_obj_id) &&
94 (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id))) {
95 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
96 return false;
97 }
98 break;
99 }
100
101 return true;
102 }
const IL_STATUS_MESSAGE
const IL_NO_OBJECT_ACCESS
$ilUser
Definition: imgupload.php:18

References $access, $ilUser, $lng, $rbacsystem, $user, IL_NO_OBJECT_ACCESS, and IL_STATUS_MESSAGE.

◆ _checkGoto()

static ilObjPortfolioTemplateAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

135 {
136 global $DIC;
137
138 $ilAccess = $DIC->access();
139
140 $t_arr = explode("_", $a_target);
141
142 if ($t_arr[0] != "prtt" || ((int) $t_arr[1]) <= 0) {
143 return false;
144 }
145
146 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
147 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
148 return true;
149 }
150 return false;
151 }

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"), );

Reimplemented from ilObjectAccess.

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

47 {
48 $commands = array(
49 array("permission" => "read", "cmd" => "preview", "lang_var" => "preview", "default" => true),
50 array("permission" => "write", "cmd" => "view", "lang_var" => "edit_content"),
51 array("permission" => "write", "cmd" => "edit", "lang_var" => "settings"),
52 array("permission" => "read", "cmd" => "createfromtemplate", "lang_var" => "prtf_create_portfolio_from_template"),
53 // array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
54 );
55
56 return $commands;
57 }

Referenced by ilObjPortfolioTemplateListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjPortfolioTemplateAccess::_lookupOnline (   $a_id)
static

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

105 {
107 }
static lookupOnline($a_id)
Is online?

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 (   $a_ids)
static

Check wether booking pool is online (legacy version)

Deprecated:

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

115 {
116 global $DIC;
117
118 $ilDB = $DIC->database();
119
120 $q = "SELECT id, is_online FROM usr_portfolio WHERE " .
121 $ilDB->in("id", $a_ids, false, "integer");
122 $lm_set = $ilDB->query($q);
123 $status = [];
124 while ($r = $ilDB->fetchAssoc($lm_set)) {
125 $status[$r["id"]] = $r["is_online"];
126 }
127 return $status;
128 }
global $ilDB
$lm_set

References $DIC, $ilDB, and $lm_set.

Referenced by ilContainer\legacyOnlineFilter().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilObjPortfolioTemplateAccess::$access
protected

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

Referenced by _checkAccess().

◆ $lng

ilObjPortfolioTemplateAccess::$lng
protected

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

Referenced by _checkAccess().

◆ $rbacsystem

ilObjPortfolioTemplateAccess::$rbacsystem
protected

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

Referenced by _checkAccess().

◆ $user

ilObjPortfolioTemplateAccess::$user
protected

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

Referenced by _checkAccess().


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