ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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="")
 
- 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...
 

Static Public Member Functions

static _getCommands ()
 
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.

References $DIC, and user().

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
$DIC
Definition: xapitoken.php:46
+ 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 = "" 
)

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

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

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

◆ _checkGoto()

static ilObjPortfolioTemplateAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

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

References $DIC.

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

◆ _getCommands()

static ilObjPortfolioTemplateAccess::_getCommands ( )
static

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

Referenced by ilObjPortfolioTemplateListGUI\init().

47  {
48  $commands = array(
49  array("permission" => "read", "cmd" => "preview", "lang_var" => "preview", "default" => true),
50  array("permission" => "write", "cmd" => "view", "lang_var" => "edit"),
51  array("permission" => "read", "cmd" => "createfromtemplate", "lang_var" => "prtf_create_portfolio_from_template"),
52  // array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
53  );
54 
55  return $commands;
56  }
+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjPortfolioTemplateAccess::_lookupOnline (   $a_id)
static

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

References ilObjPortfolioBase\lookupOnline().

Referenced by ilObjPortfolioTemplateListGUI\getProperties().

104  {
106  }
static lookupOnline($a_id)
Is online?
+ 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 113 of file class.ilObjPortfolioTemplateAccess.php.

References $DIC, $ilDB, and $lm_set.

Referenced by ilContainer\legacyOnlineFilter().

114  {
115  global $DIC;
116 
117  $ilDB = $DIC->database();
118 
119  $q = "SELECT id, is_online FROM usr_portfolio WHERE " .
120  $ilDB->in("id", $a_ids, false, "integer");
121  $lm_set = $ilDB->query($q);
122  $status = [];
123  while ($r = $ilDB->fetchAssoc($lm_set)) {
124  $status[$r["id"]] = $r["is_online"];
125  }
126  return $status;
127  }
$lm_set
global $ilDB
$DIC
Definition: xapitoken.php:46
+ 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: