This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
espocrm-base/application/Espo/Controllers/Settings.php
T
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());
}
}