Update Allowed Run-Time Property (PHP)
object->UpdateAllowed [= value]
This property contains boolean flag that if set, prevents record update operation from executing. This property is set automatically to False by the Record form if the access to the form is restricted by setting its "Restricted" property to "Yes" in the IDE. If "Restricted" is set to "No", then UpdateAllowed property is always True unless modified in the Before Update event. The value of this property can be changed in the After Initialize event of the Page.
Note: Setting this property to False in the On Validate event or the Page's After Initialize event results in hiding of the Update button.
The following example shows how to prevent a logged in user from updating an item that does not belong to him/her. Additionally, the form displays an error message.
if ($items->user_id->GetValue() != CCGetUserID())
$items->UpdateAllowed = false;
$items->Errors->addError("You are not allowed to edit this item.");
where $items is the name of the form.
On-line, printable versions and updates