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

Access handler for personal workspace. More...

+ Collaboration diagram for ilWorkspaceAccessHandler:

Public Member Functions

 __construct (ilTree $a_tree=null)
 
 getTree ()
 Get workspace tree. More...
 
 checkAccess ($a_permission, $a_cmd, $a_node_id, $a_type="")
 check access for an object More...
 
 checkAccessOfUser (ilTree $a_tree, $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)
 
 getSharedOwners ()
 
 getSharedObjects ($a_owner_id)
 
 findSharedObjects (array $a_filter=null, array $a_crs_ids=null, array $a_grp_ids=null)
 
 getObjectsIShare ()
 

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)
 
static getGotoLink ($a_node_id, $a_obj_id, $a_additional=null)
 
static getObjectDataFromNode ($a_node_id)
 

Protected Attributes

 $user
 
 $lng
 
 $rbacreview
 
 $settings
 
 $db
 
 $tree
 

Detailed Description

Access handler for personal workspace.

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 14 of file class.ilWorkspaceAccessHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceAccessHandler::__construct ( ilTree  $a_tree = null)

Definition at line 43 of file class.ilWorkspaceAccessHandler.php.

44 {
45 global $DIC;
46
47 $this->user = $DIC->user();
48 $this->lng = $DIC->language();
49 $this->rbacreview = $DIC->rbac()->review();
50 $this->settings = $DIC->settings();
51 $this->db = $DIC->database();
52 $ilUser = $DIC->user();
53 $lng = $DIC->language();
54
55 $lng->loadLanguageModule("wsp");
56
57 if (!$a_tree) {
58 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
59 $a_tree = new ilWorkspaceTree($ilUser->getId());
60 }
61 $this->tree = $a_tree;
62 }
user()
Definition: user.php:4
Tree handler for personal workspace.
settings()
Definition: settings.php:2
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _getPermissions()

static ilWorkspaceAccessHandler::_getPermissions (   $a_node_id)
static

Get all permissions to node.

Parameters
int$a_node_id
Returns
array

Definition at line 265 of file class.ilWorkspaceAccessHandler.php.

266 {
267 global $DIC;
268
269 $ilDB = $DIC->database();
270 $ilSetting = $DIC->settings();
271
272 $publish_enabled = $ilSetting->get("enable_global_profiles");
273 $publish_perm = array(ilWorkspaceAccessGUI::PERMISSION_ALL,
275
276 $set = $ilDB->query("SELECT object_id FROM acl_ws" .
277 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer"));
278 $res = array();
279 while ($row = $ilDB->fetchAssoc($set)) {
280 if ($publish_enabled || !in_array($row["object_id"], $publish_perm)) {
281 $res[] = $row["object_id"];
282 }
283 }
284 return $res;
285 }
global $ilSetting
Definition: privfeed.php:17
foreach($_POST as $key=> $value) $res
global $ilDB

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

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

+ Here is the caller graph for this function:

◆ addPermission()

ilWorkspaceAccessHandler::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
Returns
bool

Definition at line 209 of file class.ilWorkspaceAccessHandler.php.

210 {
213
214 // tree owner must not be added
215 if ($this->tree->getTreeId() == $ilUser->getId() &&
216 $a_object_id == $ilUser->getId()) {
217 return false;
218 }
219
220 $ilDB->manipulate("INSERT INTO acl_ws (node_id, object_id, extended_data, tstamp)" .
221 " VALUES (" . $ilDB->quote($a_node_id, "integer") . ", " .
222 $ilDB->quote($a_object_id, "integer") . "," .
223 $ilDB->quote($a_extended_data, "text") . "," .
224 $ilDB->quote(time(), "integer") . ")");
225 return true;
226 }

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

◆ checkAccess()

ilWorkspaceAccessHandler::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 83 of file class.ilWorkspaceAccessHandler.php.

84 {
86
87 return $this->checkAccessOfUser($this->tree, $ilUser->getId(), $a_permission, $a_cmd, $a_node_id, $a_type);
88 }
checkAccessOfUser(ilTree $a_tree, $a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type="")
check access for an object
$a_type
Definition: workflow.php:92

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

+ Here is the call graph for this function:

◆ checkAccessOfUser()

ilWorkspaceAccessHandler::checkAccessOfUser ( ilTree  $a_tree,
  $a_user_id,
  $a_permission,
  $a_cmd,
  $a_node_id,
  $a_type = "" 
)

check access for an object

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

Definition at line 101 of file class.ilWorkspaceAccessHandler.php.

102 {
106
107 // :TODO: create permission for parent node with type ?!
108
109 // #20310
110 if (!$ilSetting->get("enable_global_profiles") && $ilUser->getId() == ANONYMOUS_USER_ID) {
111 return false;
112 }
113
114 // tree root is read-only
115 if ($a_permission == "write") {
116 if ($a_tree->readRootId() == $a_node_id) {
117 return false;
118 }
119 }
120
121 // node owner has all rights
122 if ($a_tree->lookupOwner($a_node_id) == $a_user_id) {
123 return true;
124 }
125
126 // other users can only read
127 if ($a_permission == "read" || $a_permission == "visible") {
128 // get all objects with explicit permission
129 $objects = $this->getPermissions($a_node_id);
130 if ($objects) {
131 // check if given user is member of object or has role
132 foreach ($objects as $obj_id) {
133 switch ($obj_id) {
135 return true;
136
138 // check against input kept in session
139 if (self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) ||
140 $a_permission == "visible") {
141 return true;
142 }
143 break;
144
146 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
147 return true;
148 }
149 break;
150
151 default:
152 switch (ilObject::_lookupType($obj_id)) {
153 case "grp":
154 // member of group?
155 if (ilGroupParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id)) {
156 return true;
157 }
158 break;
159
160 case "crs":
161 // member of course?
162 if (ilCourseParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id)) {
163 return true;
164 }
165 break;
166
167 case "role":
168 // has role?
169 if ($rbacreview->isAssigned($a_user_id, $obj_id)) {
170 return true;
171 }
172 break;
173
174 case "usr":
175 // direct assignment
176 if ($a_user_id == $obj_id) {
177 return true;
178 }
179 break;
180 }
181 break;
182 }
183 }
184 }
185 }
186
187 return false;
188 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupType($a_id, $a_reference=false)
lookup object type
readRootId()
read root id from database
getPermissions($a_node_id)
Get all permissions to node.

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

Referenced by checkAccess().

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

◆ findSharedObjects()

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

Definition at line 399 of file class.ilWorkspaceAccessHandler.php.

400 {
403
404 if (!$a_filter["acl_type"]) {
405 $obj_ids = $this->getPossibleSharedTargets();
406 } else {
407 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
408
409 switch ($a_filter["acl_type"]) {
410 case "all":
411 $obj_ids = array(ilWorkspaceAccessGUI::PERMISSION_ALL);
412 break;
413
414 case "password":
416 break;
417
418 case "registered":
420 break;
421
422 case "course":
423 $obj_ids = $a_crs_ids;
424 break;
425
426 case "group":
427 $obj_ids = $a_grp_ids;
428 break;
429
430 case "user":
431 $obj_ids = array($ilUser->getId());
432 break;
433 }
434 }
435
436 $res = array();
437
438 $sql = "SELECT ref.wsp_id,obj.obj_id,obj.type,obj.title,obj.owner," .
439 "acl.object_id acl_type, acl.tstamp acl_date" .
440 " FROM object_data obj" .
441 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)" .
442 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)" .
443 " JOIN acl_ws acl ON (acl.node_id = tree.child)" .
444 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
445 " AND obj.owner <> " . $ilDB->quote($ilUser->getId(), "integer");
446
447 if ($a_filter["obj_type"]) {
448 $sql .= " AND obj.type = " . $ilDB->quote($a_filter["obj_type"], "text");
449 }
450 if ($a_filter["title"] && strlen($a_filter["title"]) >= 3) {
451 $sql .= " AND " . $ilDB->like("obj.title", "text", "%" . $a_filter["title"] . "%");
452 }
453 if ($a_filter["user"] && strlen($a_filter["user"]) >= 3) {
454 $usr_ids = array();
455 $set = $ilDB->query("SELECT usr_id FROM usr_data" .
456 " WHERE (" . $ilDB->like("login", "text", "%" . $a_filter["user"] . "%") . " " .
457 "OR " . $ilDB->like("firstname", "text", "%" . $a_filter["user"] . "%") . " " .
458 "OR " . $ilDB->like("lastname", "text", "%" . $a_filter["user"] . "%") . " " .
459 "OR " . $ilDB->like("email", "text", "%" . $a_filter["user"] . "%") . ")");
460 while ($row = $ilDB->fetchAssoc($set)) {
461 $usr_ids[] = $row["usr_id"];
462 }
463 if (!sizeof($usr_ids)) {
464 return;
465 }
466 $sql .= " AND " . $ilDB->in("obj.owner", $usr_ids, "", "integer");
467 }
468
469 if ($a_filter["acl_date"]) {
470 $dt = $a_filter["acl_date"]->get(IL_CAL_DATE);
471 $dt = new ilDateTime($dt . " 00:00:00", IL_CAL_DATETIME);
472 $sql .= " AND acl.tstamp > " . $ilDB->quote($dt->get(IL_CAL_UNIX), "integer");
473 }
474
475 if ($a_filter["crsgrp"]) {
476 include_once "Services/Membership/classes/class.ilParticipants.php";
477 $part = ilParticipants::getInstanceByObjId($a_filter['crsgrp']);
478 $part = $part->getParticipants();
479 if (!sizeof($part)) {
480 return;
481 }
482 $sql .= " AND " . $ilDB->in("obj.owner", $part, "", "integer");
483 }
484
485 // we use the oldest share date
486 $sql .= " ORDER BY acl.tstamp";
487
488 $set = $ilDB->query($sql);
489 while ($row = $ilDB->fetchAssoc($set)) {
490 if (!isset($res[$row["wsp_id"]])) {
491 $row["acl_type"] = array($row["acl_type"]);
492 $res[$row["wsp_id"]] = $row;
493 } else {
494 $res[$row["wsp_id"]]["acl_type"][] = $row["acl_type"];
495 }
496 }
497
498 return $res;
499 }
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:

◆ getGotoLink()

static ilWorkspaceAccessHandler::getGotoLink (   $a_node_id,
  $a_obj_id,
  $a_additional = null 
)
static

Definition at line 528 of file class.ilWorkspaceAccessHandler.php.

529 {
530 include_once('./Services/Link/classes/class.ilLink.php');
531 return ilLink::_getStaticLink($a_node_id, ilObject::_lookupType($a_obj_id), true, $a_additional . "_wsp");
532 }

References ilLink\_getStaticLink(), and ilObject\_lookupType().

Referenced by ilObjectListGUI\buildGotoLink(), ilMailNotification\createPermanentLink(), ilPortfolioPageTableGUI\fillRow(), and ilNoteGUI\renderTargets().

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

◆ getObjectDataFromNode()

static ilWorkspaceAccessHandler::getObjectDataFromNode (   $a_node_id)
static

Definition at line 553 of file class.ilWorkspaceAccessHandler.php.

554 {
555 global $DIC;
556
557 $ilDB = $DIC->database();
558
559 $set = $ilDB->query("SELECT obj.obj_id, obj.type, obj.title" .
560 " FROM object_reference_ws ref" .
561 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)" .
562 " JOIN object_data obj ON (ref.obj_id = obj.obj_id)" .
563 " WHERE ref.wsp_id = " . $ilDB->quote($a_node_id, "integer"));
564 return $ilDB->fetchAssoc($set);
565 }

References $DIC, and $ilDB.

Referenced by ilSharedResourceGUI\initPasswordForm(), and ilSharedResourceGUI\redirectToResource().

+ Here is the caller graph for this function:

◆ getObjectsIShare()

ilWorkspaceAccessHandler::getObjectsIShare ( )

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

535 {
538
539 $res = array();
540 $set = $ilDB->query("SELECT ref.wsp_id,obj.obj_id" .
541 " FROM object_data obj" .
542 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)" .
543 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)" .
544 " JOIN acl_ws acl ON (acl.node_id = tree.child)" .
545 " WHERE obj.owner = " . $ilDB->quote($ilUser->getId(), "integer"));
546 while ($row = $ilDB->fetchAssoc($set)) {
547 $res[$row["wsp_id"]] = $row["obj_id"];
548 }
549
550 return $res;
551 }

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

◆ getPermissions()

ilWorkspaceAccessHandler::getPermissions (   $a_node_id)

Get all permissions to node.

Parameters
int$a_node_id
Returns
array

Definition at line 254 of file class.ilWorkspaceAccessHandler.php.

255 {
256 return self::_getPermissions($a_node_id);
257 }
static _getPermissions($a_node_id)
Get all permissions to node.

References _getPermissions().

Referenced by checkAccessOfUser().

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

◆ getPossibleSharedTargets()

static ilWorkspaceAccessHandler::getPossibleSharedTargets ( )
static

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

328 {
329 global $DIC;
330
331 $ilUser = $DIC->user();
332 $ilSetting = $DIC->settings();
333
334 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
335 include_once "Services/Membership/classes/class.ilParticipants.php";
336 $grp_ids = ilParticipants::_getMembershipByType($ilUser->getId(), "grp");
337 $crs_ids = ilParticipants::_getMembershipByType($ilUser->getId(), "crs");
338
339 $obj_ids = array_merge($grp_ids, $crs_ids);
340 $obj_ids[] = $ilUser->getId();
342
343 if ($ilSetting->get("enable_global_profiles")) {
346 }
347
348 return $obj_ids;
349 }
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership

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

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

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

◆ getSharedNodePassword()

static ilWorkspaceAccessHandler::getSharedNodePassword (   $a_node_id)
static

Definition at line 501 of file class.ilWorkspaceAccessHandler.php.

502 {
503 global $DIC;
504
505 $ilDB = $DIC->database();
506
507 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
508
509 $set = $ilDB->query("SELECT * FROM acl_ws" .
510 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
511 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, "integer"));
512 $res = $ilDB->fetchAssoc($set);
513 if ($res) {
514 return $res["extended_data"];
515 }
516 }

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

Referenced by ilObjWorkspaceFolderGUI\checkPassword(), and ilSharedResourceGUI\checkPassword().

+ Here is the caller graph for this function:

◆ getSharedObjects()

ilWorkspaceAccessHandler::getSharedObjects (   $a_owner_id)

Definition at line 378 of file class.ilWorkspaceAccessHandler.php.

379 {
381
382 $obj_ids = $this->getPossibleSharedTargets();
383
384 $res = array();
385 $set = $ilDB->query("SELECT ref.wsp_id,obj.obj_id" .
386 " FROM object_data obj" .
387 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)" .
388 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)" .
389 " JOIN acl_ws acl ON (acl.node_id = tree.child)" .
390 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
391 " AND obj.owner = " . $ilDB->quote($a_owner_id, "integer"));
392 while ($row = $ilDB->fetchAssoc($set)) {
393 $res[$row["wsp_id"]] = $row["obj_id"];
394 }
395
396 return $res;
397 }

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

+ Here is the call graph for this function:

◆ getSharedOwners()

ilWorkspaceAccessHandler::getSharedOwners ( )

Definition at line 351 of file class.ilWorkspaceAccessHandler.php.

352 {
355
356 $obj_ids = $this->getPossibleSharedTargets();
357
358 $user_ids = array();
359 $set = $ilDB->query("SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title" .
360 " FROM object_data obj" .
361 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)" .
362 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)" .
363 " JOIN acl_ws acl ON (acl.node_id = tree.child)" .
364 " JOIN usr_data u on (u.usr_id = obj.owner)" .
365 " WHERE " . $ilDB->in("acl.object_id", $obj_ids, "", "integer") .
366 " AND obj.owner <> " . $ilDB->quote($ilUser->getId(), "integer") .
367 " ORDER BY u.lastname, u.firstname, u.title");
368 while ($row = $ilDB->fetchAssoc($set)) {
369 $user_ids[$row["owner"]] = $row["lastname"] . ", " . $row["firstname"];
370 if ($row["title"]) {
371 $user_ids[$row["owner"]] .= ", " . $row["title"];
372 }
373 }
374
375 return $user_ids;
376 }

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

+ Here is the call graph for this function:

◆ getSharedSessionPassword()

static ilWorkspaceAccessHandler::getSharedSessionPassword (   $a_node_id)
static

Definition at line 523 of file class.ilWorkspaceAccessHandler.php.

524 {
525 return $_SESSION["ilshpw_" . $a_node_id];
526 }
$_SESSION["AccountId"]

References $_SESSION.

◆ getTree()

ilWorkspaceAccessHandler::getTree ( )

Get workspace tree.

Returns
ilWorkspaceTree

Definition at line 69 of file class.ilWorkspaceAccessHandler.php.

References $tree.

◆ hasGlobalPasswordPermission()

ilWorkspaceAccessHandler::hasGlobalPasswordPermission (   $a_node_id)

Definition at line 312 of file class.ilWorkspaceAccessHandler.php.

313 {
316
317 if (!$ilSetting->get("enable_global_profiles")) {
318 return false;
319 }
320
321 $set = $ilDB->query("SELECT object_id FROM acl_ws" .
322 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
323 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, "integer"));
324 return (bool) $ilDB->numRows($set);
325 }

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

◆ hasGlobalPermission()

ilWorkspaceAccessHandler::hasGlobalPermission (   $a_node_id)

Definition at line 297 of file class.ilWorkspaceAccessHandler.php.

298 {
301
302 if (!$ilSetting->get("enable_global_profiles")) {
303 return false;
304 }
305
306 $set = $ilDB->query("SELECT object_id FROM acl_ws" .
307 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
308 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_ALL, "integer"));
309 return (bool) $ilDB->numRows($set);
310 }

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

◆ hasRegisteredPermission()

ilWorkspaceAccessHandler::hasRegisteredPermission (   $a_node_id)

Definition at line 287 of file class.ilWorkspaceAccessHandler.php.

288 {
290
291 $set = $ilDB->query("SELECT object_id FROM acl_ws" .
292 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer") .
293 " AND object_id = " . $ilDB->quote(ilWorkspaceAccessGUI::PERMISSION_REGISTERED, "integer"));
294 return (bool) $ilDB->numRows($set);
295 }

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

◆ keepSharedSessionPassword()

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

Definition at line 518 of file class.ilWorkspaceAccessHandler.php.

519 {
520 $_SESSION["ilshpw_" . $a_node_id] = $a_password;
521 }

References $_SESSION.

Referenced by ilObjWorkspaceFolderGUI\checkPassword(), and ilSharedResourceGUI\checkPassword().

+ Here is the caller graph for this function:

◆ removePermission()

ilWorkspaceAccessHandler::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 234 of file class.ilWorkspaceAccessHandler.php.

235 {
237
238 $query = "DELETE FROM acl_ws" .
239 " WHERE node_id = " . $ilDB->quote($a_node_id, "integer");
240
241 if ($a_object_id) {
242 $query .= " AND object_id = " . $ilDB->quote($a_object_id, "integer");
243 }
244
245 return $ilDB->manipulate($query);
246 }
$query

References $db, $ilDB, and $query.

◆ setPermissions()

ilWorkspaceAccessHandler::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 196 of file class.ilWorkspaceAccessHandler.php.

197 {
198 // nothing to do as owner has irrefutable rights to any workspace object
199 }

Field Documentation

◆ $db

◆ $lng

ilWorkspaceAccessHandler::$lng
protected

Definition at line 24 of file class.ilWorkspaceAccessHandler.php.

Referenced by __construct().

◆ $rbacreview

ilWorkspaceAccessHandler::$rbacreview
protected

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

Referenced by checkAccessOfUser().

◆ $settings

ilWorkspaceAccessHandler::$settings
protected

◆ $tree

ilWorkspaceAccessHandler::$tree
protected

Definition at line 41 of file class.ilWorkspaceAccessHandler.php.

Referenced by getTree().

◆ $user

ilWorkspaceAccessHandler::$user
protected

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