Activity › Forums › Salesforce® Discussions › Is it possible to grant delete permission using apex managed sharing? › Reply To: Is it possible to grant delete permission using apex managed sharing?
MemberApril 26, 2016 at 10:48 am
Try this code block to grant 'All' permission to user using apex
ObjectName__Share instance = new ObjectName__Share();
instance.ParentId = Object.id;
instance.UserOrGroupId = User/Group.id;
instance.AccessLevel = 'All';
instance.RowCause = Schema.ObjectName__Share.RowCause.Manual;
Hope above helps you.