# $editForGroup()
- Update-restricted Fields
A field configured with this keyword can only be edited by users whose accounts belong to the groups indicated in the arguments. Other users can still, nevertheless, view the value of the instance.
# Usage:
$editForGroup(Group name 1,Group name 2,...)
TIP
Besides using a list of group names, you can also use a regular expression to identify the groups that can edit the field.
# Examples:
# 1. With full group names:
$editForGroup(FUNC HR Admin)
$editForGroup(System)
The video included below shows a live example of the $editForGroup()
keyword, where the fields HR administration notes
and Last Update Date
cannot be edited by the user register_demo
because its account has not been assigned to the groups FUNC HR Admin
- $editForGroup(FUNC HR Admin)
- and System
-$editForGroup(System)
-, respectively.
# 2. With regular expressions:
$editForGroup(/FUNC E-Learning.*/)
$editForGroup(/Sys.*/)
Besides full group names, This keyword also accepts regular expressions (opens new window) as arguments. For instance, we can assign the regular expression /FUNC E-Learning.*/
as an argument of $editForGroup
to state that all user accounts belonging to groups that start with FUNC E-Learning
can edit the value of a given field. That is the case of register_demo
whose account is a member of FUNC E-Learning DEMO Read
, FUNC E-Learning Docs
, FUNC E-Learning Contributer
, FUNC E-Learning Creator
, FUNC E-Learning DEMO Creator
and FUNC E-Learning DEMO Destroyer
, among other groups. Because of that,register_demo
can edit the HR Administration Notes
field.
On the other hand, the user behind register_demo
cannot edit the field named Last Update Date
. This is because the edition of this field is reserved to all users assigned to groups that start with the characters Sys
, such as System
. However, that is not the case with register_demo
. The opposite behaviour occurs when the user holding the account mcaetano
accesses the details page of every instance of that definition. Because the account has not been assigned to any group containing the words FUNC E-Learning
, they cannot update HR Administration Notes
. They can, however, edit Last Update Date
. This is due to the fact that their account has been assigned to the System
group: