34 array(
"permission" =>
"read",
"cmd" =>
"render",
"lang_var" =>
"show",
"default" =>
true ),
35 array(
"permission" =>
"write",
"cmd" =>
"listRecords",
"lang_var" =>
"edit_content" ),
36 array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings" )
49 $ilAccess = $DIC[
'ilAccess'];
51 $t_arr = explode(
"_", $a_target);
53 if ($t_arr[0] !=
"dcl" || ((
int) $t_arr[1]) <= 0) {
57 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
74 if ($reference == $ref_id) {
94 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
99 $rbacsystem = $DIC[
'rbacsystem'];
100 $ilAccess = $DIC[
'ilAccess'];
102 if ($a_user_id ==
"") {
109 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)
126 switch ($a_permission) {
130 && (!$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id))
151 $ilDB = $DIC[
'ilDB'];
153 $q =
"SELECT * FROM il_dcl_data WHERE id = " .
$ilDB->quote($a_id,
"integer");
154 $dcl_set =
$ilDB->query($q);
155 $dcl_rec =
$ilDB->fetchAssoc($dcl_set);
157 return $dcl_rec[
"is_online"];
173 $ilAccess = $DIC[
'ilAccess'];
178 if ($ilAccess->checkAccess(
"add_entry",
"", array_shift($references))) {
195 if (self::checkActionForRefId(
$action, $ref_id)) {
210 public static function checkActionForRefId(
$action, $ref_id)
213 $ilAccess = $DIC[
'ilAccess'];
219 return $ilAccess->checkAccess(
$action,
"", $ref_id);
233 $ilAccess = $DIC[
'ilAccess'];
236 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
238 return $ilAccess->checkAccess(
"write",
"", $ref);
252 $ilAccess = $DIC[
'ilAccess'];
255 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
257 return $ilAccess->checkAccess(
"edit_content",
"", $ref);
269 $ilAccess = $DIC[
'ilAccess'];
272 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
274 return $ilAccess->checkAccess(
"add_entry",
"", $ref);
286 $ilAccess = $DIC[
'ilAccess'];
289 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
291 return $ilAccess->checkAccess(
"read",
"", $ref);
304 $rbacreview = $DIC[
'rbacreview'];
311 if (is_numeric($tableview)) {
312 $tableview = ilDclTableView::find($tableview);
315 $assigned_roles = $rbacreview->assignedRoles($user_id ? $user_id :
$ilUser->getId());
316 $allowed_roles = $tableview->getRoles();
318 return !empty(array_intersect($assigned_roles, $allowed_roles));
333 return $table->getIsVisible() || ($table_id ==
$table->getCollectionObject()->getFirstVisibleTableId());
344 public static function hasAccessTo($ref_id, $table_id, $tableview_id)
347 $tableview = ilDclTableView::find($tableview_id);
351 if (($tableview->getTableId() != $table_id)
352 || !self::isTableInDataCollection(
$table, $ref_id)) {
357 return self::hasWriteAccess($ref_id) || (
358 self::hasReadAccess($ref_id) && self::hasAccessToTable($table_id) && self::hasAccessToTableView($tableview)
372 && (self::hasWriteAccess($ref_id));
384 return self::hasAccessToFields($ref_id, $table_id);
398 return in_array($field_id,
$table->getFieldIds()) && self::hasAccessToFields($ref_id, $table_id);
410 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)
Create styles array
The data for the language used.
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)
if(empty($password)) $table
static hasAccessToField($ref_id, $table_id, $field_id)
static checkActionForObjId($action, $obj_id)
Class ilObjDataCollectionAccess.