ILIAS  release_7 Revision v7.30-3-g800a261c036
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
global $DIC
Definition: goto.php:24
+ 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 59 of file class.ilObjPortfolioTemplateAccess.php.

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

60  {
62  $lng = $this->lng;
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_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 134 of file class.ilObjPortfolioTemplateAccess.php.

References $DIC.

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  }
global $DIC
Definition: goto.php:24

◆ _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_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  }
+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjPortfolioTemplateAccess::_lookupOnline (   $a_id)
static

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

References ilObjPortfolioBase\lookupOnline().

Referenced by ilObjPortfolioTemplateListGUI\getProperties().

105  {
107  }
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 114 of file class.ilObjPortfolioTemplateAccess.php.

References $DIC, $ilDB, and $lm_set.

Referenced by ilContainer\legacyOnlineFilter().

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 $DIC
Definition: goto.php:24
$lm_set
global $ilDB
+ 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: