add capability to author role to be able to delete attachments

It seems that you have to add the capability yourself. You can get the necessary code for that in How do I create a custom role capability?.

You can also use Members Plugin which seems to do that for you(I haven’t used it myself yet). I think this discussion here will also help you to find the right direction.

EDIT: I haven’t really worked with author before. I tried to see what they can do and surprisingly they can delete their own Media uploads. So, there must be something wrong with your installation. Maybe some plugin has removed their ability to do that.

I then checked all the capabilities the author of my wordpress dev setup has. My author role has following capabilities

  • upload_files

  • edit_posts

  • edit_published_posts

  • publish_posts

  • read

  • level_2

  • level_1

  • level_0

  • delete_posts

  • delete_published_posts

I used the following code to check the capabilities.

$role = get_role('author');
foreach( $role->capabilities as $name => $val ){
    echo $name . "<br />";
}

You should check which capabilities your author have. You can compare it with the capabilities of author. Then you can add the missing capability with the code you have posted.