本文整理汇总了PHP中Object_Abstract::isAllowed方法的典型用法代码示例。如果您正苦于以下问题:PHP Object_Abstract::isAllowed方法的具体用法?PHP Object_Abstract::isAllowed怎么用?PHP Object_Abstract::isAllowed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object_Abstract
的用法示例。
在下文中一共展示了Object_Abstract::isAllowed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTreeNodePermissionConfig
/**
* @param User $user
* @param Object_Abstract $child
* @param Object_Abstract $parent
* @param boolean $expanded
* @return
*/
protected function getTreeNodePermissionConfig($user, $child, $parent, $expanded)
{
$userGroup = $user->getParent();
if ($userGroup instanceof User) {
$child->getPermissionsForUser($userGroup);
$lock_list = $child->isAllowed("list");
$lock_view = $child->isAllowed("view");
$lock_save = $child->isAllowed("save");
$lock_publish = $child->isAllowed("publish");
$lock_unpublish = $child->isAllowed("unpublish");
$lock_delete = $child->isAllowed("delete");
$lock_rename = $child->isAllowed("rename");
$lock_create = $child->isAllowed("create");
$lock_permissions = $child->isAllowed("permissions");
$lock_settings = $child->isAllowed("settings");
$lock_versions = $child->isAllowed("versions");
$lock_properties = $child->isAllowed("properties");
$lock_properties = $child->isAllowed("properties");
}
if ($parent instanceof Object_Abstract) {
$parent->getPermissionsForUser($user);
}
$objectPermissions = $child->getPermissionsForUser($user);
$generallyAllowed = $user->isAllowed("objects");
$parentId = (int) $child->getParentId();
$parentAllowedList = true;
if ($parent instanceof Object_Abstract) {
$parentAllowedList = $parent->isAllowed("list") and $generallyAllowed;
}
$listAllowed = $child->isAllowed("list");
$child->getPermissionsForUser($user);
$tmpObject = array("_parent" => $parentId > 0 ? $parentId : null, "_id" => (int) $child->getId(), "text" => $child->getKey(), "type" => $child->getType(), "path" => $child->getFullPath(), "basePath" => $child->getPath(), "elementType" => "object", "permissionSet" => $objectPermissions->getId() > 0 and $objectPermissions->getCid() === $child->getId(), "list" => $listAllowed, "list_editable" => $parentAllowedList and $generallyAllowed and !$lock_list and !$user->isAdmin(), "view" => $child->isAllowed("view"), "view_editable" => $listAllowed and $generallyAllowed and !$lock_view and !$user->isAdmin(), "save" => $child->isAllowed("save"), "save_editable" => $listAllowed and $generallyAllowed and !$lock_save and !$user->isAdmin(), "publish" => $child->isAllowed("publish"), "publish_editable" => $listAllowed and $generallyAllowed and !$lock_publish and !$user->isAdmin(), "unpublish" => $child->isAllowed("unpublish"), "unpublish_editable" => $listAllowed and $generallyAllowed and !$lock_unpublish and !$user->isAdmin(), "delete" => $child->isAllowed("delete"), "delete_editable" => $listAllowed and $generallyAllowed and !$lock_delete and !$user->isAdmin(), "rename" => $child->isAllowed("rename"), "rename_editable" => $listAllowed and $generallyAllowed and !$lock_rename and !$user->isAdmin(), "create" => $child->isAllowed("create"), "create_editable" => $listAllowed and $generallyAllowed and !$lock_create and !$user->isAdmin(), "permissions" => $child->isAllowed("permissions"), "permissions_editable" => $listAllowed and $generallyAllowed and !$lock_permissions and !$user->isAdmin(), "settings" => $child->isAllowed("settings"), "settings_editable" => $listAllowed and $generallyAllowed and !$lock_settings and !$user->isAdmin(), "versions" => $child->isAllowed("versions"), "versions_editable" => $listAllowed and $generallyAllowed and !$lock_versions and !$user->isAdmin(), "properties" => $child->isAllowed("properties"), "properties_editable" => $listAllowed and $generallyAllowed and !$lock_properties and !$user->isAdmin());
$tmpObject["expanded"] = $expanded;
$tmpObject["_is_leaf"] = $child->hasNoChilds();
$tmpObject["iconCls"] = "pimcore_icon_object";
if ($child->getType() == "folder") {
$tmpObject["iconCls"] = "pimcore_icon_folder";
$tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId());
} else {
$tmpObject["className"] = $child->getClass()->getName();
$tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId(), "text" => 'Type: ' . $child->getClass()->getName());
if (!$child->isPublished()) {
$tmpObject["cls"] = "pimcore_unpublished";
}
if ($child->getClass()->getIcon()) {
unset($tmpObject["iconCls"]);
$tmpObject["icon"] = $child->getClass()->getIcon();
}
}
return $tmpObject;
}