domain: client
language: javascript
class Item
Use can_edit
method to determine if a user have a right to edit a record of
an item dataset.
This method takes into account the user permissions set in the roles node in the Application Builder when the project safe mode parameter is set as well as the values of the permissions attribute and the value of can_modify attribute.
if (item.can_edit()) {
item.view_form.find("#edit-btn").on('click',
function() {
item.edit_record();
}
);
}
else {
item.view_form.find("#edit-btn").prop("disabled", true);
}