Plugin capabilities

public function myplugin_role_has_cap($capabilities, $cap, $args) {
    if(!isset($capabilities['myplugin_access'])) {
        unset($capabilities['myplugin_delete_item']);
    }
    return $capabilities;
}add_filter('user_has_cap', array($this, 'myplugin_role_has_cap'), 0 , 3);

Here is a better answer, that corresponds to my example.
Let’s say the plugin, on activation, adds the 2 caps to a role, and that after that for some reasons, the access cap is revoked. Then, even with only the delete_item cap, the user cannot delete, because access is not granted.