<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
/**
 * Comment/Suggestion permission.
 *
 * @link       #
 * @since      2.0.3
 *
 * @package    commenting-feature
 */
class Commenting_Block_Permissions extends Commenting_block_Functions {

	/**
	 * Get the latest activities of comments.
	 *
	 * @return array Activity data.
	 */
	public function multicollab_get_pp_roles() {
		global $wp_roles;
		$all_roles      = $wp_roles->roles;
		$data           = array();
		$editable_roles = apply_filters( 'editable_roles', $all_roles ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Core WP filter; hook name cannot be prefixed.
		if ((is_array($editable_roles) && !empty($editable_roles)) || (is_object($editable_roles) && !empty((array)$editable_roles))) {
			foreach ( $editable_roles as $key => $role ) {

				$data[ $key ]                        = array();
				$data[ $key ]['role']                = $role;
				$data[ $key ]['add_comment']         = '';
				$data[ $key ]['resolved_comment']    = '';
				$data[ $key ]['hide_comment']        = '';
			}
		}

		return $data;
	}
}
