ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilPortfolioAccessHandler Class Reference

Access handler for portfolio. More...

+ Inheritance diagram for ilPortfolioAccessHandler:
+ Collaboration diagram for ilPortfolioAccessHandler:

Public Member Functions

 __construct ()
 
 checkAccess ($a_permission, $a_cmd, $a_node_id, $a_type="")
 check access for an object More...
 
 checkAccessOfUser ($a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type="")
 check access for an object More...
 
 setPermissions ($a_parent_node_id, $a_node_id)
 Set permissions after creating node/object. More...
 
 addPermission ($a_node_id, $a_object_id, $a_extended_data=null)
 Add permission to node for object. More...
 
 removePermission ($a_node_id, $a_object_id=null)
 Remove permission[s] (for object) to node. More...
 
 getPermissions ($a_node_id)
 Get all permissions to node. More...
 
 hasRegisteredPermission ($a_node_id)
 
 hasGlobalPermission ($a_node_id)
 
 hasGlobalPasswordPermission ($a_node_id)
 
 getObjectsIShare ($a_online_only=true)
 
 getSharedOwners ()
 
 getSharedObjects ($a_owner_id)
 
 getShardObjectsDataForUserIds (array $a_owner_ids)
 
 findSharedObjects (array $a_filter=null, array $a_crs_ids=null, array $a_grp_ids=null)
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 editPortfolios ()
 Is portfolio editing (general feature) enabled. More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getPermissions ($a_node_id)
 Get all permissions to node. More...
 
static getPossibleSharedTargets ()
 
static getSharedNodePassword ($a_node_id)
 
static keepSharedSessionPassword ($a_node_id, $a_password)
 
static getSharedSessionPassword ($a_node_id)
 

Protected Member Functions

 syncProfile ($a_node_id)
 

Protected Attributes

 $lng
 
 $user
 
 $rbacreview
 
 $settings
 
 $db
 
 $access
 

Detailed Description

Access handler for portfolio.

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 10 of file class.ilPortfolioAccessHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilPortfolioAccessHandler::__construct ( )

Definition at line 42 of file class.ilPortfolioAccessHandler.php.

43 {
44 global $DIC;
45
46 $this->lng = $DIC->language();
47 $this->user = $DIC->user();
48 $this->rbacreview = $DIC->rbac()->review();
49 $this->settings = $DIC->settings();
50 $this->db = $DIC->database();
51 $this->access = $DIC->access();
52 $lng = $DIC->language();
53 $lng->loadLanguageModule("wsp");
54 }
user()
Definition: user.php:4
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $DIC, $lng, settings(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getPermissions()

static ilPortfolioAccessHandler::_getPermissions (   $a_node_id)
static

Get all permissions to node.

Parameters
int$a_node_id
Returns
array

Definition at line 257 of file class.ilPortfolioAccessHandler.php.

258 {
259 global $DIC;
260
261 $ilDB = $DIC->database();
262
263 $set = $ilDB->query("SELECT object_id FROM usr_portf_acl" .
264 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer"));
265 $res = array();
266 while ($row = $ilDB->fetchAssoc($set)) {
267 $res[] = $row["object_id"];
268 }
269 return $res;
270 }
foreach($_POST as $key=> $value) $res
global $ilDB

References $DIC, $ilDB, and $res.

Referenced by checkAccessOfUser(), getPermissions(), and ilSharedResourceGUI\hasAccess().

+ Here is the caller graph for this function:

◆ addPermission()

ilPortfolioAccessHandler::addPermission (   $a_node_id,
  $a_object_id,
  $a_extended_data = null 
)

Add permission to node for object.

Parameters
int$a_node_id
int$a_object_id
string$a_extended_data

Definition at line 197 of file class.ilPortfolioAccessHandler.php.

198 {
201
202 // current owner must not be added
203 if ($a_object_id == $ilUser->getId()) {
204 return;
205 }
206
207 $ilDB->manipulate("INSERT INTO usr_portf_acl (node_id, object_id, extended_data, tstamp)" .
208 " VALUES (" . $ilDB->quote($a_node_id, "integer") . ", " .
209 $ilDB->quote($a_object_id, "integer") . "," .
210 $ilDB->quote($a_extended_data, "text") . "," .
211 $ilDB->quote(time(), "integer") . ")");
212
213 // portfolio as profile
214 $this->syncProfile($a_node_id);
215 }
$ilUser
Definition: imgupload.php:18

References $db, $ilDB, $ilUser, $user, and syncProfile().

+ Here is the call graph for this function:

◆ canBeDelivered()

ilPortfolioAccessHandler::canBeDelivered ( ilWACPath  $ilWACPath)
Parameters
ilWACPath$ilWACPath
Returns
bool

Implements ilWACCheckingClass.

Definition at line 571 of file class.ilPortfolioAccessHandler.php.

572 {
574 $ilAccess = $this->access;
575
576 if (preg_match("/\\/prtf_([\\d]*)\\//uism", $ilWACPath->getPath(), $results)) {
577 // portfolio (custom)
578 $obj_id = $results[1];
579 if (ilObject::_lookupType($obj_id) == "prtf") {
580 if ($this->checkAccessOfUser($ilUser->getId(), "read", "view", $obj_id, "prtf")) {
581 return true;
582 }
583 }
584 // portfolio template (RBAC)
585 else {
586 $ref_ids = ilObject::_getAllReferences($obj_id);
587 foreach ($ref_ids as $ref_id) {
588 if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "view", $ref_id, "prtt", $obj_id)) {
589 return true;
590 }
591 }
592 }
593 }
594
595 return false;
596 }
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type="")
check access for an object
$results

References $access, $ilUser, $results, $user, ilObject\_getAllReferences(), ilObject\_lookupType(), checkAccessOfUser(), and ilWACPath\getPath().

+ Here is the call graph for this function:

◆ checkAccess()

ilPortfolioAccessHandler::checkAccess (   $a_permission,
  $a_cmd,
  $a_node_id,
  $a_type = "" 
)

check access for an object

Parameters
string$a_permission
string$a_cmd
int$a_node_id
string$a_type(optional)
Returns
bool

Definition at line 65 of file class.ilPortfolioAccessHandler.php.

66 {
68
69 return $this->checkAccessOfUser($ilUser->getId(), $a_permission, $a_cmd, $a_node_id, $a_type);
70 }
$a_type
Definition: workflow.php:92

References $a_type, $ilUser, $user, and checkAccessOfUser().

+ Here is the call graph for this function:

◆ checkAccessOfUser()

ilPortfolioAccessHandler::checkAccessOfUser (   $a_user_id,
  $a_permission,
  $a_cmd,
  $a_node_id,
  $a_type = "" 
)

check access for an object

Parameters
integer$a_user_id
string$a_permission
string$a_cmd
int$a_node_id
string$a_type(optional)
Returns
bool

Definition at line 82 of file class.ilPortfolioAccessHandler.php.

83 {
87
88 // #20310
89 if (!$ilSetting->get("enable_global_profiles") && $ilUser->getId() == ANONYMOUS_USER_ID) {
90 return false;
91 }
92
93 // #12059
94 if (!$ilSetting->get('user_portfolios')) {
95 return false;
96 }
97
98 // :TODO: create permission for parent node with type ?!
99
100 $pf = new ilObjPortfolio($a_node_id, false);
101 if (!$pf->getId()) {
102 return false;
103 }
104
105 // portfolio owner has all rights
106 if ($pf->getOwner() == $a_user_id) {
107 return true;
108 }
109
110 // #11921
111 if (!$pf->isOnline()) {
112 return false;
113 }
114
115 // other users can only read
116 if ($a_permission == "read" || $a_permission == "visible") {
117 // get all objects with explicit permission
118 $objects = self::_getPermissions($a_node_id);
119 if ($objects) {
120 // check if given user is member of object or has role
121 foreach ($objects as $obj_id) {
122 switch ($obj_id) {
124 return true;
125
127 // check against input kept in session
128 if (self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) ||
129 $a_permission == "visible") {
130 return true;
131 }
132 break;
133
135 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
136 return true;
137 }
138 break;
139
140 default:
141 switch (ilObject::_lookupType($obj_id)) {
142 case "grp":
143 // member of group?
144 if (ilGroupParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id)) {
145 return true;
146 }
147 break;
148
149 case "crs":
150 // member of course?
151 if (ilCourseParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id)) {
152 return true;
153 }
154 break;
155
156 case "role":
157 // has role?
158 if ($rbacreview->isAssigned($a_user_id, $obj_id)) {
159 return true;
160 }
161 break;
162
163 case "usr":
164 // direct assignment
165 if ($a_user_id == $obj_id) {
166 return true;
167 }
168 break;
169 }
170 break;
171 }
172 }
173 }
174 }
175
176 return false;
177 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getPermissions($a_node_id)
Get all permissions to node.
global $ilSetting
Definition: privfeed.php:17

References $ilSetting, $ilUser, $rbacreview, $settings, $user, ilCourseParticipants\_getInstanceByObjId(), ilGroupParticipants\_getInstanceByObjId(), _getPermissions(), ilObject\_lookupType(), ilWorkspaceAccessGUI\PERMISSION_ALL, ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD, and ilWorkspaceAccessGUI\PERMISSION_REGISTERED.

Referenced by canBeDelivered(), and checkAccess().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editPortfolios()

ilPortfolioAccessHandler::editPortfolios ( )

Is portfolio editing (general feature) enabled.

Definition at line 601 of file class.ilPortfolioAccessHandler.php.

601 : bool
602 {
603 return (bool) $this->settings->get('user_portfolios');
604 }

References settings().

+ Here is the call graph for this function:

◆ findSharedObjects()

ilPortfolioAccessHandler::findSharedObjects ( array  $a_filter = null,
array  $a_crs_ids = null,
array  $a_grp_ids = null 
)

Definition at line 415 of file class.ilPortfolioAccessHandler.php.

416 {
419 if (!$a_filter["acl_type"]) {
420 $obj_ids = $this->getPossibleSharedTargets();
421 } else {
422 switch ($a_filter["acl_type"]) {
423 case "all":
424 $obj_ids = array(ilWorkspaceAccessGUI::PERMISSION_ALL);
425 break;
426
427 case "password":
429 break;
430
431 case "registered":
433 break;
434
435 case "course":
436 $obj_ids = $a_crs_ids;
437 break;
438
439 case "group":
440 $obj_ids = $a_grp_ids;
441 break;
442
443 case "user":
444 $obj_ids = array($ilUser->getId());
445 break;
446 }
447 }
448
449 $res = array();
450
451 $sql = "SELECT obj.obj_id,obj.title,obj.owner" .
452 ",acl.object_id acl_type, acl.tstamp acl_date" .
453 " FROM object_data obj" .
454 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
455 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
456 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
457 " AND obj.owner <> " . $ilDB->quote($ilUser->getId(), "integer") .
458 " AND obj.type = " . $ilDB->quote("prtf", "text") .
459 " AND prtf.is_online = " . $ilDB->quote(1, "integer");
460
461 if ($a_filter["title"] && strlen($a_filter["title"]) >= 3) {
462 $sql .= " AND " . $ilDB->like("obj.title", "text", "%" . $a_filter["title"] . "%");
463 }
464 if ($a_filter["user"] && strlen($a_filter["user"]) >= 3) {
465 $usr_ids = array();
466 $set = $ilDB->query("SELECT usr_id FROM usr_data" .
467 " WHERE (" . $ilDB->like("login", "text", "%" . $a_filter["user"] . "%") . " " .
468 "OR " . $ilDB->like("firstname", "text", "%" . $a_filter["user"] . "%") . " " .
469 "OR " . $ilDB->like("lastname", "text", "%" . $a_filter["user"] . "%") . " " .
470 "OR " . $ilDB->like("email", "text", "%" . $a_filter["user"] . "%") . ")");
471 while ($row = $ilDB->fetchAssoc($set)) {
472 $usr_ids[] = $row["usr_id"];
473 }
474 if (!sizeof($usr_ids)) {
475 return;
476 }
477 $sql .= " AND " . $ilDB->in("obj.owner", $usr_ids, "", "integer");
478 }
479
480 if ($a_filter["acl_date"]) {
481 $dt = $a_filter["acl_date"]->get(IL_CAL_DATE);
482 $dt = new ilDateTime($dt . " 00:00:00", IL_CAL_DATETIME);
483 $sql .= " AND acl.tstamp > " . $ilDB->quote($dt->get(IL_CAL_UNIX), "integer");
484 }
485
486 if ($a_filter["crsgrp"]) {
487 $part = ilParticipants::getInstanceByObjId($a_filter['crsgrp']);
488 $part = $part->getParticipants();
489 if (!sizeof($part)) {
490 return;
491 }
492 $sql .= " AND " . $ilDB->in("obj.owner", $part, "", "integer");
493 }
494
495 // we use the oldest share date
496 $sql .= " ORDER BY acl.tstamp";
497
498 $set = $ilDB->query($sql);
499 while ($row = $ilDB->fetchAssoc($set)) {
500 if (!isset($res[$row["obj_id"]])) {
501 $row["acl_type"] = array($row["acl_type"]);
502 $res[$row["obj_id"]] = $row;
503 } else {
504 $res[$row["obj_id"]]["acl_type"][] = $row["acl_type"];
505 }
506 }
507
508 return $res;
509 }
const IL_CAL_DATE
const IL_CAL_UNIX
const IL_CAL_DATETIME
@classDescription Date and time handling
static getInstanceByObjId($a_obj_id)
Get instance by obj type.

References $db, $ilDB, $ilUser, $res, $user, ilParticipants\getInstanceByObjId(), getPossibleSharedTargets(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, ilWorkspaceAccessGUI\PERMISSION_ALL, ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD, and ilWorkspaceAccessGUI\PERMISSION_REGISTERED.

+ Here is the call graph for this function:

◆ getObjectsIShare()

ilPortfolioAccessHandler::getObjectsIShare (   $a_online_only = true)

Definition at line 302 of file class.ilPortfolioAccessHandler.php.

303 {
306
307 $res = array();
308
309 $sql = "SELECT obj.obj_id" .
310 " FROM object_data obj" .
311 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
312 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
313 " WHERE obj.owner = " . $ilDB->quote($ilUser->getId(), "integer");
314
315 if ($a_online_only) {
316 $sql .= " AND prtf.is_online = " . $ilDB->quote(1, "integer");
317 }
318
319 $set = $ilDB->query($sql);
320 while ($row = $ilDB->fetchAssoc($set)) {
321 $res[] = $row["obj_id"];
322 }
323
324 return $res;
325 }

References $db, $ilDB, $ilUser, $res, and $user.

◆ getPermissions()

ilPortfolioAccessHandler::getPermissions (   $a_node_id)

Get all permissions to node.

Parameters
int$a_node_id
Returns
array

Definition at line 246 of file class.ilPortfolioAccessHandler.php.

247 {
248 return self::_getPermissions($a_node_id);
249 }

References _getPermissions().

+ Here is the call graph for this function:

◆ getPossibleSharedTargets()

static ilPortfolioAccessHandler::getPossibleSharedTargets ( )
static

Definition at line 327 of file class.ilPortfolioAccessHandler.php.

328 {
329 global $DIC;
330
331 $ilUser = $DIC->user();
332
333 $grp_ids = ilParticipants::_getMembershipByType($ilUser->getId(), "grp");
334 $crs_ids = ilParticipants::_getMembershipByType($ilUser->getId(), "crs");
335
336 $obj_ids = array_merge($grp_ids, $crs_ids);
337 $obj_ids[] = $ilUser->getId();
341
342 return $obj_ids;
343 }
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership

References $DIC, $ilUser, ilParticipants\_getMembershipByType(), ilWorkspaceAccessGUI\PERMISSION_ALL, ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD, and ilWorkspaceAccessGUI\PERMISSION_REGISTERED.

Referenced by findSharedObjects(), getShardObjectsDataForUserIds(), getSharedObjects(), and getSharedOwners().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShardObjectsDataForUserIds()

ilPortfolioAccessHandler::getShardObjectsDataForUserIds ( array  $a_owner_ids)

Definition at line 393 of file class.ilPortfolioAccessHandler.php.

394 {
396
397 $obj_ids = $this->getPossibleSharedTargets();
398
399 $res = array();
400
401 $set = $ilDB->query("SELECT obj.obj_id, obj.owner, obj.title" .
402 " FROM object_data obj" .
403 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
404 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
405 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
406 " AND " . $ilDB->in("obj.owner", $a_owner_ids, "", "integer") .
407 " AND prtf.is_online = " . $ilDB->quote(1, "integer"));
408 while ($row = $ilDB->fetchAssoc($set)) {
409 $res[$row["owner"]][$row["obj_id"]] = $row["title"];
410 }
411
412 return $res;
413 }

References $db, $ilDB, $res, and getPossibleSharedTargets().

+ Here is the call graph for this function:

◆ getSharedNodePassword()

static ilPortfolioAccessHandler::getSharedNodePassword (   $a_node_id)
static

Definition at line 511 of file class.ilPortfolioAccessHandler.php.

512 {
513 global $DIC;
514
515 $ilDB = $DIC->database();
516
517 $set = $ilDB->query("SELECT extended_data FROM usr_portf_acl" .
518 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
519 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, "integer"));
520 $res = $ilDB->fetchAssoc($set);
521 if ($res) {
522 return $res["extended_data"];
523 }
524 }

References $DIC, $ilDB, $res, and ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD.

Referenced by ilSharedResourceGUI\checkPassword().

+ Here is the caller graph for this function:

◆ getSharedObjects()

ilPortfolioAccessHandler::getSharedObjects (   $a_owner_id)

Definition at line 372 of file class.ilPortfolioAccessHandler.php.

373 {
375
376 $obj_ids = $this->getPossibleSharedTargets();
377
378 $res = array();
379 $set = $ilDB->query("SELECT obj.obj_id, obj.owner" .
380 " FROM object_data obj" .
381 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
382 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
383 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
384 " AND obj.owner = " . $ilDB->quote($a_owner_id, "integer") .
385 " AND prtf.is_online = " . $ilDB->quote(1, "integer"));
386 while ($row = $ilDB->fetchAssoc($set)) {
387 $res[$row["obj_id"]] = $row["obj_id"];
388 }
389
390 return $res;
391 }

References $db, $ilDB, $res, and getPossibleSharedTargets().

+ Here is the call graph for this function:

◆ getSharedOwners()

ilPortfolioAccessHandler::getSharedOwners ( )

Definition at line 345 of file class.ilPortfolioAccessHandler.php.

346 {
349
350 $obj_ids = $this->getPossibleSharedTargets();
351
352 $user_ids = array();
353 $set = $ilDB->query("SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title" .
354 " FROM object_data obj" .
355 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
356 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
357 " JOIN usr_data u on (u.usr_id = obj.owner)" .
358 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
359 " AND obj.owner <> " . $ilDB->quote($ilUser->getId(), "integer") .
360 " AND prtf.is_online = " . $ilDB->quote(1, "integer") .
361 " ORDER BY u.lastname, u.firstname, u.title");
362 while ($row = $ilDB->fetchAssoc($set)) {
363 $user_ids[$row["owner"]] = $row["lastname"] . ", " . $row["firstname"];
364 if ($row["title"]) {
365 $user_ids[$row["owner"]] .= ", " . $row["title"];
366 }
367 }
368
369 return $user_ids;
370 }

References $db, $ilDB, $ilUser, $user, and getPossibleSharedTargets().

+ Here is the call graph for this function:

◆ getSharedSessionPassword()

static ilPortfolioAccessHandler::getSharedSessionPassword (   $a_node_id)
static

Definition at line 531 of file class.ilPortfolioAccessHandler.php.

532 {
533 return $_SESSION["ilshpw_" . $a_node_id];
534 }
$_SESSION["AccountId"]

References $_SESSION.

◆ hasGlobalPasswordPermission()

ilPortfolioAccessHandler::hasGlobalPasswordPermission (   $a_node_id)

Definition at line 292 of file class.ilPortfolioAccessHandler.php.

293 {
295
296 $set = $ilDB->query("SELECT object_id FROM usr_portf_acl" .
297 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
298 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, "integer"));
299 return (bool) $ilDB->numRows($set);
300 }

References $db, $ilDB, and ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD.

◆ hasGlobalPermission()

ilPortfolioAccessHandler::hasGlobalPermission (   $a_node_id)

Definition at line 282 of file class.ilPortfolioAccessHandler.php.

283 {
285
286 $set = $ilDB->query("SELECT object_id FROM usr_portf_acl" .
287 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
288 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL, "integer"));
289 return (bool) $ilDB->numRows($set);
290 }

References $db, $ilDB, and ilWorkspaceAccessGUI\PERMISSION_ALL.

Referenced by syncProfile().

+ Here is the caller graph for this function:

◆ hasRegisteredPermission()

ilPortfolioAccessHandler::hasRegisteredPermission (   $a_node_id)

Definition at line 272 of file class.ilPortfolioAccessHandler.php.

273 {
275
276 $set = $ilDB->query("SELECT object_id FROM usr_portf_acl" .
277 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
278 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_REGISTERED, "integer"));
279 return (bool) $ilDB->numRows($set);
280 }

References $db, $ilDB, and ilWorkspaceAccessGUI\PERMISSION_REGISTERED.

Referenced by syncProfile().

+ Here is the caller graph for this function:

◆ keepSharedSessionPassword()

static ilPortfolioAccessHandler::keepSharedSessionPassword (   $a_node_id,
  $a_password 
)
static

Definition at line 526 of file class.ilPortfolioAccessHandler.php.

527 {
528 $_SESSION["ilshpw_" . $a_node_id] = $a_password;
529 }

References $_SESSION.

Referenced by ilSharedResourceGUI\checkPassword().

+ Here is the caller graph for this function:

◆ removePermission()

ilPortfolioAccessHandler::removePermission (   $a_node_id,
  $a_object_id = null 
)

Remove permission[s] (for object) to node.

Parameters
int$a_node_id
int$a_object_id

Definition at line 223 of file class.ilPortfolioAccessHandler.php.

224 {
226
227 $query = "DELETE FROM usr_portf_acl" .
228 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer");
229
230 if ($a_object_id) {
231 $query .= " AND object_id = " . $ilDB->quote($a_object_id, "integer");
232 }
233
234 $ilDB->manipulate($query);
235
236 // portfolio as profile
237 $this->syncProfile($a_node_id);
238 }
$query

References $db, $ilDB, $query, and syncProfile().

+ Here is the call graph for this function:

◆ setPermissions()

ilPortfolioAccessHandler::setPermissions (   $a_parent_node_id,
  $a_node_id 
)

Set permissions after creating node/object.

Parameters
int$a_parent_node_id
int$a_node_id

Definition at line 185 of file class.ilPortfolioAccessHandler.php.

186 {
187 // nothing to do as owner has irrefutable rights to any portfolio object
188 }

◆ syncProfile()

ilPortfolioAccessHandler::syncProfile (   $a_node_id)
protected

Definition at line 536 of file class.ilPortfolioAccessHandler.php.

537 {
539
540 // #12845
541 if (ilObjPortfolio::getDefaultPortfolio($ilUser->getId()) == $a_node_id) {
542 $has_registered = $this->hasRegisteredPermission($a_node_id);
543 $has_global = $this->hasGlobalPermission($a_node_id);
544
545 // not published anymore - remove portfolio as profile
546 if (!$has_registered && !$has_global) {
547 $ilUser->setPref("public_profile", "n");
548 $ilUser->writePrefs();
550 }
551 // adapt profile setting
552 else {
553 $new_pref = "y";
554 if ($has_global) {
555 $new_pref = "g";
556 }
557 if ($ilUser->getPref("public_profile") != $new_pref) {
558 $ilUser->setPref("public_profile", $new_pref);
559 $ilUser->writePrefs();
560 }
561 }
562 }
563 }
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.

References $ilUser, $user, ilObjPortfolio\getDefaultPortfolio(), hasGlobalPermission(), hasRegisteredPermission(), and ilObjPortfolio\setUserDefault().

Referenced by addPermission(), and removePermission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilPortfolioAccessHandler::$access
protected

Definition at line 40 of file class.ilPortfolioAccessHandler.php.

Referenced by canBeDelivered().

◆ $db

◆ $lng

ilPortfolioAccessHandler::$lng
protected

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

Referenced by __construct().

◆ $rbacreview

ilPortfolioAccessHandler::$rbacreview
protected

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

Referenced by checkAccessOfUser().

◆ $settings

ilPortfolioAccessHandler::$settings
protected

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

Referenced by checkAccessOfUser().

◆ $user


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