本文整理汇总了PHP中access_policy::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP access_policy::instance方法的具体用法?PHP access_policy::instance怎么用?PHP access_policy::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类access_policy
的用法示例。
在下文中一共展示了access_policy::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
function _init_dataspace(&$request)
{
$access_policy =& access_policy :: instance();
$data['policy'] = $access_policy->get_object_access_by_ids($this->object_ids, ACCESSOR_TYPE_GROUP);
$this->dataspace->merge($data);
}
示例2: _valid_perform
function _valid_perform(&$request, &$response)
{
$data = $this->dataspace->export();
$access_policy =& access_policy::instance();
$access_policy->save_group_object_access($data['policy']);
$request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
}
示例3: _valid_perform
function _valid_perform()
{
$tree =& tree::instance();
$params = array();
$params['identifier'] = $this->dataspace->get('identifier');
$params['parent_path'] = $this->dataspace->get('parent_path');
$params['class'] = $this->dataspace->get('class_name');
$params['title'] = $this->dataspace->get('title');
$object =& site_object_factory::create($params['class']);
$is_root = false;
if (!($parent_data = fetch_one_by_path($params['parent_path']))) {
if ($params['parent_path'] == '/') {
$is_root = true;
} else {
error("parent wasn't retrieved", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
}
if (!$is_root) {
$params['parent_node_id'] = $parent_data['node_id'];
} else {
$params['parent_node_id'] = 0;
}
$object->import_attributes($params);
if (!$object->create($is_root)) {
error("object wasn't registered", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
if (!$is_root) {
$parent_object =& site_object_factory::instance($parent_data['class_name']);
$parent_object->import_attributes($parent_data);
$access_policy =& access_policy::instance();
$access_policy->save_object_access($object, $parent_object);
}
return new close_popup_response(RESPONSE_STATUS_FORM_SUBMITTED);
}
示例4: _valid_perform
function _valid_perform()
{
$data = $this->dataspace->export();
$access_policy =& access_policy::instance();
$access_policy->save_group_object_access($data['policy']);
return new response(RESPONSE_STATUS_FORM_SUBMITTED);
}
示例5: array
function _process_loaded_items(& $items)
{
if (!count($items))
return $items;
$parent_node_ids = array();
foreach($items as $key => $data)
if (!isset($parent_node_ids[$data['parent_node_id']]))
{
$parent_node_ids[$data['parent_node_id']] = $data['parent_node_id'];
}
$fetcher =& fetcher :: instance();
$access_policy =& access_policy :: instance();
$params = array(
'restrict_by_class' => false
);
$parents =& $fetcher->fetch_by_node_ids($parent_node_ids, 'site_object', $parents_counter, $params, 'fetch_by_ids');
foreach($items as $key => $data)
{
$parent_data = $parents[$data['parent_node_id']];
$items[$key]['parent_title'] = $parent_data['title'];
$items[$key]['parent_path'] = $parent_data['path'];
}
}
示例6: _valid_perform
function _valid_perform()
{
$data = $this->_export();
$access_policy =& access_policy::instance();
$access_policy->save_group_object_access($data['policy']);
return true;
}
示例7: _apply_access_policy
function _apply_access_policy($object, $action)
{
$access_policy =& access_policy::instance();
if (!$access_policy->save_object_access_for_action($object, $action)) {
error('access template for action not defined', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('action' => $action));
}
}
示例8: _valid_perform
function _valid_perform(&$request, &$response)
{
$tree =& tree::instance();
$params = array();
$params['identifier'] = $this->dataspace->get('identifier');
$params['class'] = $this->dataspace->get('class_name');
$params['title'] = $this->dataspace->get('title');
$params['parent_node_id'] = $this->dataspace->get('parent_node_id');
$params['controller_id'] = site_object_controller::get_id($this->dataspace->get('controller_name'));
$object =& site_object_factory::create($params['class']);
if (!($parent_data = fetch_one_by_node_id($params['parent_node_id']))) {
error("parent wasn't retrieved", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
$object->merge_attributes($params);
if (!$object->create()) {
error("object wasn't registered", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
$parent_object =& site_object_factory::create($parent_data['class_name']);
$parent_object->merge_attributes($parent_data);
$access_policy =& access_policy::instance();
$access_policy->save_initial_object_access($object, $parent_object);
$request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
if ($request->has_attribute('popup')) {
$response->write(close_popup_response($request));
}
}
示例9: perform
function perform()
{
$access_policy =& access_policy::instance();
$data['policy'] = $access_policy->get_group_object_access();
$this->dataspace->import($data);
return parent::perform();
}
示例10: _write_create_access_policy
function _write_create_access_policy()
{
$parent_data =& $this->_load_parent_object_data();
$parent_object =& site_object_factory::instance($parent_data['class_name']);
$parent_object->import_attributes($parent_data);
$access_policy =& access_policy::instance();
$access_policy->save_object_access($this->object, $parent_object);
}
示例11: _write_create_access_policy
function _write_create_access_policy(&$object)
{
$parent_data =& fetch_mapped_by_url();
$parent_object =& site_object_factory::instance($parent_data['class_name']);
$parent_object->import_attributes($parent_data);
$access_policy =& access_policy::instance();
$access_policy->save_object_access($object, $parent_object);
}
示例12: perform
function perform()
{
if (!parent::perform()) {
return false;
}
$access_policy =& access_policy::instance();
$data['policy'] = $access_policy->get_group_object_access();
$this->_import($data);
return true;
}
示例13: perform
function perform(&$request, &$response)
{
$access_policy =& access_policy :: instance();
$data['policy'] = $access_policy->get_group_object_access();
$this->dataspace->import($data);
parent :: perform($request, $response);
}
示例14: _valid_perform
function _valid_perform()
{
if (!isset($_REQUEST['class_id'])) {
return false;
}
$data = $this->_export();
$access_policy =& access_policy::instance();
$access_policy->save_group_action_access_template($_REQUEST['class_id'], $data['template']);
close_popup_no_parent_reload();
}
示例15: _valid_perform
function _valid_perform()
{
if (!isset($_REQUEST['class_id'])) {
error('class_id not defined', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
$data = $this->dataspace->export();
$access_policy =& access_policy::instance();
$access_policy->save_group_action_access_template($_REQUEST['class_id'], $data['template']);
return new close_popup_no_reload_response(RESPONSE_STATUS_FORM_SUBMITTED);
}