WP Rocket add capabilities to editor

function wpe_rocket_add_purge_posts_to_editor() {
	// gets the author role object
	$role = get_role('editor');
 	// add a new capability
	//$role->add_cap('rocket_manage_options', true);
	$role->add_cap('rocket_purge_cache', true);
	$role->add_cap('rocket_purge_posts', true);
	$role->remove_cap('rocket_manage_options');
}
add_action('init', 'wpe_rocket_add_purge_posts_to_editor', 12);