N
N
nikegk2018-12-10 21:54:16
1C-Bitrix
nikegk, 2018-12-10 21:54:16

How to set the rights to the infoblock so that the user can only edit his own entries?

Hello.
Please tell me how to correctly set the rights to the infoblock in the following situation.
There is a user group "editors", this group has access to the admin panel and access to the "articles" infoblock. How can I make it so that users from this group can only edit their own posts, i.e. only the ones they created, and the rest were readable? You need it in the admin.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2018-12-11
@winer

OnBeforeIBlockElementUpdate
In the event:
1) Check whether the current user belongs to the Content Editors group. You can use CSite::InGroup
2) If yes, then by the ID of the Element in the $arParams event, make a request CIBlockElement::GetByID .
3) Compare CREATED_BY from request and global $USER->GetID();
4) If they don't match:

$APPLICATION->throwException("Элемент может генерировать только создатель");
return false;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question