public function filePermission($path, $mode = self::CHMOD_775)
    {
        $results = array();
        $success = 0;
        if(file_exists($path)) {
            if(!is_writable($path))
                chmod($path, $mode);

            if(!is_readable($path))
                chmod($path, $mode);

            if(is_readable($path) && is_writable($path))
                $status = 1;
        }

        $results = array(
            'path' => $path,
            'mode' => $mode,
            'success' => $success
        );

        return Json::encode($results);
    }