5 require_once(
"./Services/Object/classes/class.ilObjectAccess.php");
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" )
47 $ilAccess = $DIC[
'ilAccess'];
49 $t_arr = explode(
"_", $a_target);
51 if ($t_arr[0] !=
"dcl" || ((
int)$t_arr[1]) <= 0) {
55 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
91 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"") {
95 $rbacsystem = $DIC[
'rbacsystem'];
96 $ilAccess = $DIC[
'ilAccess'];
98 if ($a_user_id ==
"") {
105 && ! $rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)
118 $ilAccess->addInfoItem(IL_STATUS_MESSAGE,
$lng->txt(
"online"));
122 switch ($a_permission) {
126 && (! $rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id))
146 $ilDB = $DIC[
'ilDB'];
148 $q =
"SELECT * FROM il_dcl_data WHERE id = " .
$ilDB->quote($a_id,
"integer");
149 $dcl_set =
$ilDB->query($q);
150 $dcl_rec =
$ilDB->fetchAssoc($dcl_set);
152 return $dcl_rec[
"is_online"];
167 $ilAccess = $DIC[
'ilAccess'];
172 if ($ilAccess->checkAccess(
"add_entry",
"", array_shift($references))) {
188 if (self::checkActionForRefId($action, $ref_id)) {
203 public static function checkActionForRefId($action,
$ref_id) {
205 $ilAccess = $DIC[
'ilAccess'];
211 return $ilAccess->checkAccess($action,
"",
$ref_id);
224 $ilAccess = $DIC[
'ilAccess'];
227 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
229 return $ilAccess->checkAccess(
"write",
"", $ref);
242 $ilAccess = $DIC[
'ilAccess'];
245 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
247 return $ilAccess->checkAccess(
"edit_content",
"", $ref);
258 $ilAccess = $DIC[
'ilAccess'];
261 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
263 return $ilAccess->checkAccess(
"add_entry",
"", $ref);
274 $ilAccess = $DIC[
'ilAccess'];
277 return $ilAccess->checkAccessOfUser($user_id,
"write",
"", $ref);
279 return $ilAccess->checkAccess(
"read",
"", $ref);
292 $rbacreview = $DIC[
'rbacreview'];
299 if (is_numeric($tableview)) {
300 $tableview = ilDclTableView::find($tableview);
303 $assigned_roles = $rbacreview->assignedRoles($user_id ? $user_id :
$ilUser->getId());
304 $allowed_roles = $tableview->getRoles();
306 return !empty(array_intersect($assigned_roles, $allowed_roles));
320 return $table->getIsVisible() || ($table_id == $table->getCollectionObject()->getFirstVisibleTableId());
331 public static function hasAccessTo(
$ref_id, $table_id, $tableview_id) {
333 $tableview = ilDclTableView::find($tableview_id);
337 if (($tableview->getTableId() != $table_id)
338 || !self::isTableInDataCollection($table,
$ref_id)) {
343 return self::hasWriteAccess(
$ref_id) || (
344 self::hasReadAccess(
$ref_id) && self::hasAccessToTable($table_id) && self::hasAccessToTableView($tableview));
356 && (self::hasWriteAccess(
$ref_id));
367 return self::hasAccessToFields(
$ref_id, $table_id);
380 return in_array($field_id, $table->getFieldIds()) && self::hasAccessToFields(
$ref_id, $table_id);
391 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)
static hasAccessToField($ref_id, $table_id, $field_id)
static checkActionForObjId($action, $obj_id)
Class ilObjDataCollectionAccess.