A
A
Alexander Grenaderov2019-07-31 14:16:56
1C-Bitrix
Alexander Grenaderov, 2019-07-31 14:16:56

Show the user only his entries in the infoblock in the Bitrix admin panel?

There was a task to show users only their own entries in the infoblock in the Bitrix admin panel.
The support service said that there is no such boxed solution.
Look at the implementation option:
1) I made a copy of the infoblock display file from /bitrix/modules/iblock/admin/iblock_list_admin.php
to an arbitrary location
/bitrix/components/modules/iblock_list_admin.php
2) In the /bitrix/admin/iblock_list_admin.php file I added the following edit:
(depending on the number of the information block, I include a custom file)

if($_REQUEST['IBLOCK_ID'] == 223) {
  require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/components/modules/iblock_list_admin.php");
} else {
  require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/iblock/admin/iblock_list_admin.php");
}

3) In the custom file /bitrix/components/modules/iblock_list_admin.php
Before the line
$rsData = CIBlockSection::GetMixedList($arOrder, $arFilter, false, ['ID', 'IBLOCK_ID']);
Added a check for the user group and added a filter by the changer.
if (!in_array(22, $USER->GetUserGroupArray())) {
    $arFilter["MODIFIED_BY"] = $USER->GetID();
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question