<?php

namespace api\v2\system;
use api\v2\Base;

use function api\v2\import_common;
import_common();

class components extends Base {

    public function authorized_for_get() {
        return true;
    }

    public function authorized_for_post() {
        return is_admin();
    }

    public function authorized_for_delete() {
        return is_admin();
    }

    public function authorized_for_put() {
        return is_admin();
    }

    public function get() {
        $dir = get_root_dir() . "/html/includes/components/";
        return array_values(array_diff(scandir($dir), array('..', '.')));
    }
}
