Restricting shortcode for users

i think this might work with you

function myshortcode(){

$user = wp_get_current_user();
if ( !in_array( 'author', (array) $user->roles ) ) {
    //Run shortcode
}

}

add_shortcode('myshortcode','myshortcode');

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