ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPortfolioAccessHandler Class Reference

Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise. More...

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

Public Member Functions

 __construct ()
 
 checkAccess (string $a_permission, string $a_cmd, int $a_node_id, string $a_type="")
 check access for an object More...
 
 checkAccessOfUser (int $a_user_id, string $a_permission, string $a_cmd, int $a_node_id, string $a_type="")
 check access for an object More...
 
 setPermissions (int $a_parent_node_id, int $a_node_id)
 Set permissions after creating node/object. More...
 
 addPermission (int $a_node_id, int $a_object_id, ?string $a_extended_data=null)
 Add permission to node for object. More...
 
 removePermission (int $a_node_id, ?int $a_object_id=null)
 Remove permission[s] (for object) to node. More...
 
 getPermissions (int $a_node_id)
 Get all permissions to node. More...
 
 hasRegisteredPermission (int $a_node_id)
 
 hasGlobalPermission (int $a_node_id)
 
 hasGlobalPasswordPermission (int $a_node_id)
 
 getObjectsIShare (bool $a_online_only=true)
 
 getSharedOwners ()
 
 getSharedObjects (int $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)
 WAC check. More...
 
 editPortfolios ()
 Is portfolio editing (general feature) enabled. More...
 
 addMissingPermissionForObjects (int $node_id, array $objects)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

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

Protected Member Functions

 syncProfile (int $a_node_id)
 
 sendSharedNotification (int $node_id, array $object_ids)
 

Protected Attributes

AccessSessionRepository $session_repo
 
ilLanguage $lng
 
ilObjUser $user
 
ilRbacReview $rbacreview
 
ilSetting $settings
 
ilDBInterface $db
 
ilAccessHandler $access
 

Detailed Description

Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.

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

Constructor & Destructor Documentation

◆ __construct()

ilPortfolioAccessHandler::__construct ( )

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

37 {
38 global $DIC;
39
40 $this->lng = $DIC->language();
41 $this->user = $DIC->user();
42 $this->rbacreview = $DIC->rbac()->review();
43 $this->settings = $DIC->settings();
44 $this->db = $DIC->database();
45 $this->access = $DIC->access();
46 $lng = $DIC->language();
48 $this->session_repo = $DIC->portfolio()
49 ->internal()
50 ->repo()
51 ->accessSession();
52 }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, ILIAS\Repository\access(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getPermissions()

static ilPortfolioAccessHandler::_getPermissions ( int  $a_node_id)
static

Get all permissions to node.

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

253 : array {
254 global $DIC;
255
256 $ilDB = $DIC->database();
257
258 $set = $ilDB->query("SELECT object_id FROM usr_portf_acl" .
259 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer"));
260 $res = array();
261 while ($row = $ilDB->fetchAssoc($set)) {
262 $res[] = $row["object_id"];
263 }
264 return $res;
265 }
$res
Definition: ltiservices.php:69

◆ addMissingPermissionForObjects()

ilPortfolioAccessHandler::addMissingPermissionForObjects ( int  $node_id,
array  $objects 
)

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

626 : bool
627 {
628 $existing = $this->getPermissions($node_id);
629 $added_obj_ids = [];
630 foreach ($objects as $object_id) {
631 if (!in_array($object_id, $existing)) {
632 $added_obj_ids[] = $object_id;
633 $this->addPermission($node_id, $object_id);
634 $added = true;
635 }
636 }
637 $this->sendSharedNotification($node_id, $added_obj_ids);
638 return (count($added_obj_ids) > 0);
639 }
sendSharedNotification(int $node_id, array $object_ids)
addPermission(int $a_node_id, int $a_object_id, ?string $a_extended_data=null)
Add permission to node for object.
getPermissions(int $a_node_id)
Get all permissions to node.

◆ addPermission()

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

Add permission to node for object.

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

193 : void {
195 $ilUser = $this->user;
196
197 // current owner must not be added
198 if ($a_object_id === $ilUser->getId()) {
199 return;
200 }
201
202 $ilDB->replace(
203 "usr_portf_acl",
204 [
205 "node_id" => ["integer", $a_node_id],
206 "object_id" => ["integer", $a_object_id]
207 ],
208 [
209 "extended_data" => ["text", $a_extended_data],
210 "tstamp" => ["integer", time()]
211 ]
212 );
213
214 // portfolio as profile
215 $this->syncProfile($a_node_id);
216 }

◆ canBeDelivered()

ilPortfolioAccessHandler::canBeDelivered ( ilWACPath  $ilWACPath)

WAC check.

Implements ilWACCheckingClass.

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

593 : bool {
594 $ilUser = $this->user;
595 $ilAccess = $this->access;
596 if (preg_match("/\\/prtf_([\\d]+)\\//uim", $ilWACPath->getPath(), $results)) {
597 // portfolio (custom)
598 $obj_id = $results[1];
599 if (ilObject::_lookupType($obj_id) === "prtf") {
600 if ($this->checkAccessOfUser($ilUser->getId(), "read", "view", $obj_id, "prtf")) {
601 return true;
602 }
603 }
604 // portfolio template (RBAC)
605 else {
606 $ref_ids = ilObject::_getAllReferences($obj_id);
607 foreach ($ref_ids as $ref_id) {
608 if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "view", $ref_id, "prtt", $obj_id)) {
609 return true;
610 }
611 }
612 }
613 }
614
615 return false;
616 }
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
checkAccessOfUser(int $a_user_id, string $a_permission, string $a_cmd, int $a_node_id, string $a_type="")
check access for an object
$ref_id
Definition: ltiauth.php:66
$results

References $ref_id, $results, ilObject\_getAllReferences(), and ilObject\_lookupType().

+ Here is the call graph for this function:

◆ checkAccess()

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

check access for an object

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

62 : bool {
63 $ilUser = $this->user;
64
65 return $this->checkAccessOfUser($ilUser->getId(), $a_permission, $a_cmd, $a_node_id, $a_type);
66 }

◆ checkAccessOfUser()

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

check access for an object

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

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

◆ editPortfolios()

ilPortfolioAccessHandler::editPortfolios ( )

Is portfolio editing (general feature) enabled.

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

621 : bool
622 {
623 return (bool) $this->settings->get('user_portfolios');
624 }

References ILIAS\Repository\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 416 of file class.ilPortfolioAccessHandler.php.

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

◆ getObjectsIShare()

ilPortfolioAccessHandler::getObjectsIShare ( bool  $a_online_only = true)

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

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

◆ getPermissions()

ilPortfolioAccessHandler::getPermissions ( int  $a_node_id)

Get all permissions to node.

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

243 : array
244 {
245 return self::_getPermissions($a_node_id);
246 }

◆ getPossibleSharedTargets()

static ilPortfolioAccessHandler::getPossibleSharedTargets ( )
static

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

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

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

+ Here is the call graph for this function:

◆ getShardObjectsDataForUserIds()

ilPortfolioAccessHandler::getShardObjectsDataForUserIds ( array  $a_owner_ids)

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

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

◆ getSharedNodePassword()

static ilPortfolioAccessHandler::getSharedNodePassword ( int  $a_node_id)
static

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

519 : string {
520 global $DIC;
521
522 $ilDB = $DIC->database();
523
524 $set = $ilDB->query("SELECT extended_data FROM usr_portf_acl" .
525 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
526 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, "integer"));
527 $res = $ilDB->fetchAssoc($set);
528 if ($res) {
529 return $res["extended_data"];
530 }
531 return "";
532 }

References $res.

Referenced by ilSharedResourceGUI\checkPassword().

+ Here is the caller graph for this function:

◆ getSharedObjects()

ilPortfolioAccessHandler::getSharedObjects ( int  $a_owner_id)

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

373 : array {
375
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 }

◆ getSharedOwners()

ilPortfolioAccessHandler::getSharedOwners ( )

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

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

References $ilDB.

◆ getSharedSessionPassword()

static ilPortfolioAccessHandler::getSharedSessionPassword ( int  $a_node_id)
static

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

548 : string {
549 global $DIC;
550 $session_repo = $DIC->portfolio()
551 ->internal()
552 ->repo()
553 ->accessSession();
554 return $session_repo->getSharedSessionPassword($a_node_id);
555 }

◆ hasGlobalPasswordPermission()

ilPortfolioAccessHandler::hasGlobalPasswordPermission ( int  $a_node_id)

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

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

◆ hasGlobalPermission()

ilPortfolioAccessHandler::hasGlobalPermission ( int  $a_node_id)

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

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

◆ hasRegisteredPermission()

ilPortfolioAccessHandler::hasRegisteredPermission ( int  $a_node_id)

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

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

◆ keepSharedSessionPassword()

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

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

537 : void {
538 global $DIC;
539 $session_repo = $DIC->portfolio()
540 ->internal()
541 ->repo()
542 ->accessSession();
543 $session_repo->setSharedSessionPassword($a_node_id, $a_password);
544 }

Referenced by ilSharedResourceGUI\checkPassword().

+ Here is the caller graph for this function:

◆ removePermission()

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

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

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

224 : void {
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 }

References $ilDB.

◆ sendSharedNotification()

ilPortfolioAccessHandler::sendSharedNotification ( int  $node_id,
array  $object_ids 
)
protected

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

641 : void
642 {
643 if (count($object_ids) === 0) {
644 return;
645 }
646 $not = new \ILIAS\Portfolio\Notification\SharedNotification();
647 $not->setObjId($node_id);
648 $not->setSharedToObjectIds($object_ids);
649 //$not->setRecipients($user_ids);
650 $not->send();
651 }

◆ setPermissions()

ilPortfolioAccessHandler::setPermissions ( int  $a_parent_node_id,
int  $a_node_id 
)

Set permissions after creating node/object.

Parameters
int$a_parent_node_id
int$a_node_id

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

182 : void {
183 // nothing to do as owner has irrefutable rights to any portfolio object
184 }

◆ syncProfile()

ilPortfolioAccessHandler::syncProfile ( int  $a_node_id)
protected

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

559 : void {
560 $ilUser = $this->user;
561
562 // #12845
563 if (ilObjPortfolio::getDefaultPortfolio($ilUser->getId()) === $a_node_id) {
564 $has_registered = $this->hasRegisteredPermission($a_node_id);
565 $has_global = $this->hasGlobalPermission($a_node_id);
566
567 // not published anymore - remove portfolio as profile
568 if (!$has_registered && !$has_global) {
569 $ilUser->setPref("public_profile", "n");
570 $ilUser->writePrefs();
571 ilObjPortfolio::setUserDefault($ilUser->getId());
572 }
573 // adapt profile setting
574 else {
575 $new_pref = "y";
576 if ($has_global) {
577 $new_pref = "g";
578 }
579 if ($ilUser->getPref("public_profile") !== $new_pref) {
580 $ilUser->setPref("public_profile", $new_pref);
581 $ilUser->writePrefs();
582 }
583 }
584 }
585 }
static getDefaultPortfolio(int $a_user_id)

Field Documentation

◆ $access

ilAccessHandler ilPortfolioAccessHandler::$access
protected

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

◆ $db

ilDBInterface ilPortfolioAccessHandler::$db
protected

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

◆ $lng

ilLanguage ilPortfolioAccessHandler::$lng
protected

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

Referenced by __construct().

◆ $rbacreview

ilRbacReview ilPortfolioAccessHandler::$rbacreview
protected

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

◆ $session_repo

AccessSessionRepository ilPortfolioAccessHandler::$session_repo
protected

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

◆ $settings

ilSetting ilPortfolioAccessHandler::$settings
protected

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

◆ $user

ilObjUser ilPortfolioAccessHandler::$user
protected

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


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