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])) {
73 if ($reference == $ref_id) {
93 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
98 $rbacsystem = $DIC[
'rbacsystem'];
99 $ilAccess = $DIC[
'ilAccess'];
101 if ($a_user_id ==
"") {
108 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)
125 switch ($a_permission) {
129 && (!$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id))
150 $ilDB = $DIC[
'ilDB'];
152 $q =
"SELECT * FROM il_dcl_data WHERE id = " .
$ilDB->quote($a_id,
"integer");
153 $dcl_set =
$ilDB->query($q);
154 $dcl_rec =
$ilDB->fetchAssoc($dcl_set);
156 return $dcl_rec[
"is_online"];
172 $ilAccess = $DIC[
'ilAccess'];
177 if ($ilAccess->checkAccess(
"add_entry",
"", array_shift($references))) {
194 if (self::checkActionForRefId(
$action, $ref_id)) {
209 public static function checkActionForRefId(
$action, $ref_id)
212 $ilAccess = $DIC[
'ilAccess'];
218 return $ilAccess->checkAccess(
$action,
"", $ref_id);
232 $ilAccess = $DIC[
'ilAccess'];
235 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
238 return $ilAccess->checkAccess(
"write",
"", $ref);
253 $ilAccess = $DIC[
'ilAccess'];
256 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
259 return $ilAccess->checkAccess(
"edit_content",
"", $ref);
272 $ilAccess = $DIC[
'ilAccess'];
275 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
278 return $ilAccess->checkAccess(
"add_entry",
"", $ref);
291 $ilAccess = $DIC[
'ilAccess'];
294 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
297 return $ilAccess->checkAccess(
"read",
"", $ref);
312 $rbacreview = $DIC[
'rbacreview'];
318 if (is_numeric($tableview)) {
319 $tableview = ilDclTableView::find($tableview);
322 $assigned_roles = $rbacreview->assignedRoles($user_id ? $user_id :
$ilUser->getId());
323 $allowed_roles = $tableview->getRoles();
325 return !empty(array_intersect($assigned_roles, $allowed_roles));
340 return $table->getIsVisible() || ($table_id ==
$table->getCollectionObject()->getFirstVisibleTableId());
351 public static function hasAccessTo($ref_id, $table_id, $tableview_id)
354 $tableview = ilDclTableView::find($tableview_id);
358 if (($tableview->getTableId() != $table_id)
359 || !self::isTableInDataCollection(
$table, $ref_id)) {
364 return self::hasWriteAccess($ref_id) || (
365 self::hasReadAccess($ref_id) && self::hasAccessToTable($table_id) && self::hasAccessToTableView($tableview)
379 && (self::hasWriteAccess($ref_id));
391 return self::hasAccessToFields($ref_id, $table_id);
405 return in_array($field_id,
$table->getFieldIds()) && self::hasAccessToFields($ref_id, $table_id);
417 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)
if(empty($password)) $table
static hasAccessToField($ref_id, $table_id, $field_id)
static checkActionForObjId($action, $obj_id)
Class ilObjDataCollectionAccess.