33 array(
"permission" =>
"read",
"cmd" =>
"render",
"lang_var" =>
"show",
"default" =>
true),
34 array(
"permission" =>
"write",
"cmd" =>
"listRecords",
"lang_var" =>
"edit_content"),
35 array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings"),
48 $ilAccess = $DIC[
'ilAccess'];
50 $t_arr = explode(
"_", $a_target);
52 if ($t_arr[0] !=
"dcl" || ((
int) $t_arr[1]) <= 0) {
56 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
57 $ilAccess->checkAccess(
"visible",
"", $t_arr[1])) {
74 if ($reference == $ref_id) {
95 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
100 $rbacsystem = $DIC[
'rbacsystem'];
101 $ilAccess = $DIC[
'ilAccess'];
103 if ($a_user_id ==
"") {
110 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)
127 switch ($a_permission) {
131 && (!$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id))
152 $ilDB = $DIC[
'ilDB'];
154 $q =
"SELECT * FROM il_dcl_data WHERE id = " .
$ilDB->quote($a_id,
"integer");
155 $dcl_set =
$ilDB->query($q);
156 $dcl_rec =
$ilDB->fetchAssoc($dcl_set);
158 return $dcl_rec[
"is_online"];
174 $ilAccess = $DIC[
'ilAccess'];
179 if ($ilAccess->checkAccess(
"add_entry",
"", array_shift($references))) {
196 if (self::checkActionForRefId($action, $ref_id)) {
211 public static function checkActionForRefId($action, $ref_id)
214 $ilAccess = $DIC[
'ilAccess'];
220 return $ilAccess->checkAccess($action,
"", $ref_id);
234 $ilAccess = $DIC[
'ilAccess'];
237 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
240 return $ilAccess->checkAccess(
"write",
"", $ref);
255 $ilAccess = $DIC[
'ilAccess'];
258 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
261 return $ilAccess->checkAccess(
"edit_content",
"", $ref);
274 $ilAccess = $DIC[
'ilAccess'];
277 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
280 return $ilAccess->checkAccess(
"add_entry",
"", $ref);
293 $ilAccess = $DIC[
'ilAccess'];
296 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
299 return $ilAccess->checkAccess(
"read",
"", $ref);
314 $rbacreview = $DIC[
'rbacreview'];
320 if (is_numeric($tableview)) {
321 $tableview = ilDclTableView::find($tableview);
324 $assigned_roles = $rbacreview->assignedRoles($user_id ? $user_id :
$ilUser->getId());
325 $allowed_roles = $tableview->getRoles();
327 return !empty(array_intersect($assigned_roles, $allowed_roles));
343 return $table->getIsVisible() || ($table_id == $table->getCollectionObject()->getFirstVisibleTableId());
354 public static function hasAccessTo($ref_id, $table_id, $tableview_id)
357 $tableview = ilDclTableView::find($tableview_id);
361 if (($tableview->getTableId() != $table_id)
362 || !self::isTableInDataCollection($table, $ref_id)
368 return self::hasWriteAccess($ref_id)
370 self::hasReadAccess($ref_id) && self::hasAccessToTable($table_id) && self::hasAccessToTableView($tableview)
384 && (self::hasWriteAccess($ref_id));
396 return self::hasAccessToFields($ref_id, $table_id);
411 return in_array($field_id, $table->getFieldIds()) && self::hasAccessToFields($ref_id, $table_id);
424 if (!self::isTableInDataCollection($table, $ref_id)) {
static hasAddRecordAccess($ref, $user_id=0)
static _lookupOnline($a_id)
Check wether datacollection is online.
static hasPermissionToAddRecord($ref_id, $table_id)
static hasReadAccess($ref, $user_id=0)
const IL_NO_OBJECT_ACCESS
static hasAccessToTableView($tableview, $user_id=0)
This only checks access to the tableview - if the full access check is required, use hasAccessTo($ref...
static hasAccessToEditTable($ref_id, $table_id)
_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 getTableCache($table_id=0)
static _getCommands()
get commands
static _getAllReferences($a_id)
static isTableInDataCollection($table, $ref_id)
static hasAccessToFields($ref_id, $table_id)
static hasEditAccess($ref, $user_id=0)
Has permission to view and edit all entries event when he is not the owner.
static hasWriteAccess($ref, $user_id=0)
static _checkGoto($a_target)
check whether goto script will succeed
static hasAccessToTable($table_id)
returns true if either the table is visible for all users, or no tables are visible and this is the t...
static checkAccessForDataCollectionId($data_collection_id)
static hasAccessToField($ref_id, $table_id, $field_id)
static checkActionForObjId($action, $obj_id)
Class ilObjDataCollectionAccess.