ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
$DIC
Definition: xapitoken.php:46

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

59 {
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_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 133 of file class.ilObjPortfolioTemplateAccess.php.

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 }

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

Referenced by ilObjPortfolioTemplateListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjPortfolioTemplateAccess::_lookupOnline (   $a_id)
static

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

104 {
106 }
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 113 of file class.ilObjPortfolioTemplateAccess.php.

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 }
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: