Custom post type media upload error with custom user role

This is very strange. I have got it working by setting edit_others_posts and edit_private_posts to true!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)