Question
Block deletion of data records for every role and group
17:53 Feb 02, 2023
Dear Community,
is there any way to block the deletion of records of an object for all users and user groups (including system administrators and the supervisor) depending on a lookup value, such as a status.
Adjusting the object permissions still let's sysadmins delete a record.
Like
1 comments
11:43 Feb 07, 2023
Hello Markus,
You can write your own EventListeren on onDeletnig event and if your condition is satisfied, you can call base.OnDeleting(sender, e).
If not, it will block the delete action no matter who is the user.
public override void OnDeleting(object sender, EntityBeforeEventArgs e) { var entityOrderProduct = (Entity)sender; var OrderProductid = entityOrderProduct.PrimaryColumnValue; string name = entityOrderProduct.GetTypedColumnValue<string>("Name"); if (name != 'someting'){ base.OnDeleting(sender, e); } }
Show all comments