Files
espocrm/application/Espo/Controllers/Settings.php
Taras Machyshyn 96f419a39a isAdmin fixes
2013-11-25 13:45:16 +02:00

24 lines
559 B
PHP

<?php
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
class Settings extends \Espo\Core\Controllers\Base
{
public function actionRead($params, $data)
{
return $this->getConfig()->getJsonData($this->getUser()->isAdmin());
}
public function actionPatch($params, $data)
{
$result = $this->getConfig()->setJsonData($data, $this->getUser()->isAdmin());
if ($result === false) {
throw new Error('Cannot save settings');
}
return $this->getConfig()->getJsonData($this->getUser()->isAdmin());
}
}