F
F
fotonboxx2016-02-25 00:07:53
1C
fotonboxx, 2016-02-25 00:07:53

How in 1C 8.3 to restrict access to the field in the form ("Restricting access to data") by role?

Good afternoon!
It is necessary that a user with a certain role cannot edit some fields on the form.
Found in the properties of the document, the "Permissions" tab at the bottom "Restricting access to data."
There you need to select a field and write a certain query, the question is what to write in it?
Options like If RoleAvailable("MyRole") Then or just RoleAvailable("MyRole") don't work.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
gunsmyth, 2016-02-25
@fotonboxx

"Restriction of access to data" in the "Permissions" tab is an implementation of the RLS mechanism (restriction of rights at the record level). There you can configure access to individual elements (records) of a table of a document or directory. Those. not to individual document details, but to individual documents selected in the request.
You can simply use RoleAvailable("MyRole") in the form 's "On Open" event to control the accessibility of individual form elements, where "MyRole" is the role you want to grant access to the details.

Процедура ПриОткрытии()
  
  ЭлементыФормы.Реквизит1.Доступность = РольДоступна("МояРоль");
  ЭлементыФормы.Реквизит2.Доступность = РольДоступна("МояРоль");
  ////////
  ЭлементыФормы.Реквизит10.Доступность = РольДоступна("МояРоль");
  
КонецПроцедуры

K
Konstantin Nagibovich, 2016-02-25
@nki

It is not necessary to write a request. For the selected role and field, check the boxes for the required rights. If you need to prohibit editing, then it is enough to put read and view.

F
fotonboxx, 2016-02-25
@fotonboxx

Konstantin Nagibovich Konstantin Nagibovich
I was talking about this form:
i.piccy.info/i9/b4e82950df5aa93b1c4395dd10396c9d/1...
Is there another one? =)
gunsmyth gunsmyth
RLS I will try not to use it in order not to lose performance, and architecturally it is not very correct.
Thanks, the obvious way =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question