ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjectAccess.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
17{
33 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
34 {
35
36 // add no access info item and return false if access is not granted
37 // $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $a_text, $a_data = "");
38 //
39 // for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:
40 // $rbacsystem->checkAccessOfUser($a_user_id, $a_permission, $a_ref_id)
41
42 return true;
43 }
44
50 public function _checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
51 {
52 switch ($a_operator) {
53 default:
54 return true;
55 }
56 }
57
70 public static function _getCommands()
71 {
72 $commands = array(
73 array()
74 );
75
76 return $commands;
77 }
78
82 public static function _checkGoto($a_target)
83 {
84 global $DIC;
85
86 $ilAccess = $DIC->access();
87
88 $t_arr = explode("_", $a_target);
89
90 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
91 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
92 return true;
93 }
94 return false;
95 }
96
106 public static function _isOffline($a_obj_id)
107 {
108 global $DIC;
109
110 $objDefinition = $DIC['objDefinition'];
111 if ($objDefinition->supportsOfflineHandling(ilObject::_lookupType($a_obj_id))) {
112 return ilObject::lookupOfflineStatus($a_obj_id);
113 }
114 return null;
115 }
116
122 public static function _preloadData($a_obj_ids, $a_ref_ids)
123 {
124 }
125
129 public function canBeDelivered(ilWACPath $ilWACPath)
130 {
131 global $ilAccess;
132
133 preg_match("/\\/obj_([\\d]*)\\//uism", $ilWACPath->getPath(), $results);
134 foreach (ilObject2::_getAllReferences($results[1]) as $ref_id) {
135 if ($ilAccess->checkAccess('visible', '', $ref_id) || $ilAccess->checkAccess('read', '', $ref_id)) {
136 return true;
137 }
138 }
139
140 return false;
141 }
142}
An exception for terminatinating execution or to throw for unit testing.
static _getAllReferences($a_id)
get all reference ids of object
Class ilObjectAccess.
_checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static _getCommands()
get commands
static _checkGoto($a_target)
check whether goto script will succeed
static _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
_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::checkAcce...
static _isOffline($a_obj_id)
Type-specific implementation of general status, has to be overwritten if object type does not support...
canBeDelivered(ilWACPath $ilWACPath)
bool
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilWACPath.
global $DIC
Definition: goto.php:24
Class ilWACCheckingClass.
$results