Delete access cannot be provided by sharing rules hence
Custom__share object does not come into picture for your scenario.
In such a case, only those users can delete a record who
- Is the record owner.
- Is higher than the owner in the owner's role hierarchy
- Has the 'Modify All' permission
Other than these scenarios, user will get insufficient privileges error. You can refer Salesforce Help for further information.
In such scenarios, you can
- Build a custom button which calls apex which runs in system context. This will allow deletion of record as it will run in system context.
- Change the ownership of the record from trigger to a
Queue which includes that user OR to the user who wants to delete the record.
Modify All permission to that user using a permission set.
Note : To provide
Delete access to records which are not owned by user, you do not need to have
Modify All Data, user with
Modify All permission can delete those records
- Modify All Data: Create, edit, and delete all organization data, regardless of sharing settings.
- Modify All: Give Read, Add, Delete permission to selected Object, Create permission is not included in Modify All permission.