public function getRoles($name)
    {
        $route = $this->router->getRoutes()->getByName($name);

        // If route not exists, return NULL
        if ($route === null) {
            return null;
        }

        $roles = [];

        // Get permissions from array syntax
        $action = $route->getAction();

        if (array_key_exists('role', $action)) {
            $roles[] = $action['role'];
        }

        if (array_key_exists('roles', $action)) {
            $roles = array_merge($roles, $action['roles']);
        }

        return array_unique($roles);
    }