Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/model/modx/processors/security/access/policy/ |
<?php /** * Updates a policy * * @param integer $id The ID of the policy * @param string $name The name of the policy. * @param string $description (optional) A short description * @param integer $parent (optional) A parent policy * @param string $class * @param json $data The JSON-encoded policy data * * @package modx * @subpackage processors.security.access.policy */ class modAccessPolicyUpdateProcessor extends modObjectUpdateProcessor { public $classKey = 'modAccessPolicy'; public $languageTopics = array('policy'); public $permission = 'policy_save'; public $objectType = 'policy'; public function beforeSave() { /* now store the permissions into the modAccessPermission table */ /* and cache the data into the policy table */ $permissions = $this->getProperty('permissions',null); if ($permissions !== null) { $permData = array(); $permissions = is_array($permissions) ? $permissions : $this->modx->fromJSON($permissions); foreach ($permissions as $permissionArray) { $permData[$permissionArray['name']] = $permissionArray['enabled'] ? true : false; } $this->object->set('data',$permData); } return parent::beforeSave(); } } return 'modAccessPolicyUpdateProcessor';