Disable revision access for a specific user role

I resolved this in the end by removing access to the revisions meta box for certain user types…

if (get_current_user_role()=="custom_user_role"){
function my_remove_revisions() {
    remove_meta_box('revisionsdiv', 'apartments', 'normal');
}
  add_action( 'admin_menu', 'my_remove_revisions' );
}

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