HEX
Server: LiteSpeed
System: Linux server240.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: creaqbdc (8964)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/essential-blocks/includes/API/Common.php
<?php

namespace EssentialBlocks\API;

class Common extends Base
{
    /**
     * Register REST Routes
     *
     * @return void
     */
    public function register()
    {
        $this->get('roles', [
            'callback' => [$this, 'get_roles'],
            'permission_callback' => [$this, 'check_edit_page_permission']
        ]);
    }

    /**
     * Check if user has permission to edit pages
     *
     * @return bool
     */
    public function check_edit_page_permission()
    {
        return current_user_can('edit_posts');
    }

    public function get_roles()
    {
        global $wp_roles;
        return rest_ensure_response($wp_roles->roles);
    }
}