本文整理汇总了PHP中AgileSellerManager::hasOwnership方法的典型用法代码示例。如果您正苦于以下问题:PHP AgileSellerManager::hasOwnership方法的具体用法?PHP AgileSellerManager::hasOwnership怎么用?PHP AgileSellerManager::hasOwnership使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AgileSellerManager
的用法示例。
在下文中一共展示了AgileSellerManager::hasOwnership方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: can_edit
private function can_edit()
{
global $cookie;
if (!Module::isInstalled('agilemultipleseller')) {
return true;
}
if ($this->table == 'image' or $this->table == 'product_attribute') {
return true;
}
if (intval($cookie->profile) == 0) {
return true;
}
if ($cookie->profile > 0 and $cookie->profile != (int) Configuration::get('AGILE_MS_PROFILE_ID')) {
return true;
}
$eaccess = AgileSellerManager::get_entity_access($this->table);
$xr_table = $eaccess['owner_xr_table'];
if (empty($xr_table)) {
if (intval($this->id) <= 0) {
return true;
}
if ($this->id == $cookie->id_employee and $this->table == 'employee') {
return true;
}
if (!AgileSellerManager::hasOwnership($this->table, $this->id)) {
return false;
}
} else {
$xr_objid = intval($this->{'id_' . $xr_table});
if (intval($xr_objid) <= 0) {
return true;
}
if (!AgileSellerManager::hasOwnership($xr_table, $xr_objid)) {
return false;
}
}
return true;
}
示例2: can_edit
private function can_edit()
{
global $cookie;
if (!Module::isInstalled('agilemultipleseller')) {
return true;
}
if (!$this->is_seller) {
return true;
}
$eaccess = AgileSellerManager::get_entity_access($this->table);
$objid = Tools::getValue('id_' . $this->table, 0);
if ($objid == $cookie->id_employee and $this->table == 'employee') {
return true;
}
if (empty($eaccess['owner_xr_table'])) {
if (intval($objid) <= 0) {
return true;
}
$has_ownership = AgileSellerManager::hasOwnership($this->table, $objid);
if ($objid > 0) {
return $has_ownership;
}
if ((isset($_GET['submitAdd' . $this->table]) or isset($_POST['submitAdd' . $this->table])) and $objid == 0) {
return true;
}
return false;
} else {
$xr_objid = AgileSellerManager::getXRObjectID($this->table, $objid);
$has_ownership = AgileSellerManager::hasOwnership($eaccess['owner_xr_table'], $xr_objid);
return $has_ownership;
}
}