当前位置: 首页>>代码示例>>PHP>>正文


PHP access_policy::instance方法代码示例

本文整理汇总了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);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:group_objects_access_tree_toggle_action.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:set_group_objects_access.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:register_new_object_action.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:set_group_objects_access.class.php

示例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'];
    }
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:29,代码来源:last_objects_datasource.class.php

示例6: _valid_perform

 function _valid_perform()
 {
     $data = $this->_export();
     $access_policy =& access_policy::instance();
     $access_policy->save_group_object_access($data['policy']);
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:set_group_access.class.php

示例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));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:set_publish_status_action.class.php

示例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));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:register_new_object_action.class.php

示例9: perform

 function perform()
 {
     $access_policy =& access_policy::instance();
     $data['policy'] = $access_policy->get_group_object_access();
     $this->dataspace->import($data);
     return parent::perform();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:group_objects_access_tree_toggle_action.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:form_create_site_object_action.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:form_create_site_object_action.class.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:group_objects_access_tree_toggle_action.class.php

示例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);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:group_objects_access_tree_toggle_action.class.php

示例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();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:set_group_access_template_action.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:set_group_access_template_action.class.php


注:本文中的access_policy::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。