本文整理汇总了PHP中eZPolicyLimitation::createNew方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPolicyLimitation::createNew方法的具体用法?PHP eZPolicyLimitation::createNew怎么用?PHP eZPolicyLimitation::createNew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPolicyLimitation
的用法示例。
在下文中一共展示了eZPolicyLimitation::createNew方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->policy = eZPolicy::createNew(
1, array( 'ModuleName' => 'foo', 'FunctionName' => 'bar' )
);
eZPolicyLimitation::createNew(
$this->policy->attribute( 'id' ), 'Owner'
);
}
示例2: processDropdownLimitations
/**
* Applies the POST submitted limitations as found in the dropdowns
* @param eZPolicy $policy
* @param string $currentModule
* @param string $currentFunction
* @param array $currentFunctionLimitations
*
* @return bool True if limitations were found, false otherwise
*/
function processDropdownLimitations( &$policy, $currentModule, $currentFunction, $currentFunctionLimitations )
{
$hasLimitation = false;
$http = eZHTTPTool::instance();
$db = eZDB::instance();
$db->begin();
foreach ( $currentFunctionLimitations as $functionLimitation )
{
if ( $http->hasPostVariable( $functionLimitation['name'] ) and
$functionLimitation['name'] != 'Node' and
$functionLimitation['name'] != 'Subtree' )
{
$limitationValueList = $http->postVariable( $functionLimitation['name'] );
if ( !in_array('-1', $limitationValueList ) )
{
$hasLimitation = true;
$policyLimitation = eZPolicyLimitation::createNew( $policy->attribute( 'id' ),
$functionLimitation['name'] );
foreach ( $limitationValueList as $limitationValue )
{
eZPolicyLimitationValue::createNew( $policyLimitation->attribute( 'id' ), $limitationValue );
}
}
}
}
$db->commit();
return $hasLimitation;
}
示例3: array
$node = eZContentObjectTreeNode::fetch($nodeID);
$nodeList[] = $node;
}
}
}
if ($http->hasPostVariable('SelectedNodeIDArray') and $http->postVariable('BrowseActionName') == 'FindLimitationSubtree' and !$http->hasPostVariable('BrowseCancelButton')) {
$selectedSubtreeIDList = $http->postVariable('SelectedNodeIDArray');
if ($http->hasSessionVariable('BrowsePolicyID')) {
$policy = eZPolicy::fetch($http->sessionVariable('BrowsePolicyID'));
} else {
$policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => ''));
$http->setSessionVariable('BrowsePolicyID', $policy->attribute('id'));
}
$subtreeLimitation = eZPolicyLimitation::fetchByIdentifier($policy->attribute('id'), 'Subtree');
if ($subtreeLimitation == null) {
$subtreeLimitation = eZPolicyLimitation::createNew($policy->attribute('id'), 'Subtree');
}
foreach ($selectedSubtreeIDList as $nodeID) {
if (!in_array($nodeID, $subtreeIDList)) {
$subtree = eZContentObjectTreeNode::fetch($nodeID);
$pathString = $subtree->attribute('path_string');
$policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
$subtreeList[] = $subtree;
}
}
}
if ($http->hasPostVariable('Limitation') && count($currentFunctionLimitations) == 0) {
$currentModule = $http->postVariable('CurrentModule');
$currentFunction = $http->postVariable('ModuleFunction');
eZDebugSetting::writeDebug('kernel-role-edit', $currentModule, 'currentModule');
$policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction));
示例4: array
$node = eZContentObjectTreeNode::fetch($nodeID);
$nodeList[] = $node;
}
}
}
if ($http->hasPostVariable('SelectedNodeIDArray') and $http->postVariable('BrowseActionName') == 'FindLimitationSubtree' and !$http->hasPostVariable('BrowseCancelButton')) {
$selectedSubtreeIDList = $http->postVariable('SelectedNodeIDArray');
if ($http->hasSessionVariable('BrowsePolicyID')) {
$policy = eZPolicy::fetch($http->sessionVariable('BrowsePolicyID'));
} else {
$policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => ''));
$http->setSessionVariable('BrowsePolicyID', $policy->attribute('id'));
}
$subtreeLimitation = eZPolicyLimitation::fetchByIdentifier($policy->attribute('id'), 'Subtree');
if ($subtreeLimitation == null) {
$subtreeLimitation = eZPolicyLimitation::createNew($policy->attribute('id'), 'Subtree', $currentModule, $currentFunction);
}
foreach ($selectedSubtreeIDList as $nodeID) {
if (!in_array($nodeID, $subtreeIDList)) {
$subtree = eZContentObjectTreeNode::fetch($nodeID);
$pathString = $subtree->attribute('path_string');
$policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
$subtreeList[] = $subtree;
}
}
}
if ($http->hasPostVariable('Limitation') && count($currentFunctionLimitations) == 0) {
$currentModule = $http->postVariable('CurrentModule');
$currentFunction = $http->postVariable('ModuleFunction');
eZDebugSetting::writeDebug('kernel-role-edit', $currentModule, 'currentModule');
$policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction));
示例5: copy
function copy($policyID)
{
$newParameter = eZPolicyLimitation::createNew($policyID, $this->attribute('identifier'));
foreach ($this->attribute('values') as $value) {
$value->copy($newParameter->attribute('id'));
}
}
示例6: foreach
$nodeLimitation = eZPolicyLimitation::createNew($policyID, "Node", $currentModule, $currentFunction);
}
foreach ($selectedNodeIDList as $nodeID) {
if (!in_array($nodeID, $nodeIDList)) {
$nodeLimitationValue = eZPolicyLimitationValue::createNew($nodeLimitation->attribute('id'), $nodeID);
$node = eZContentObjectTreeNode::fetch($nodeID);
$nodeList[] = $node;
}
}
}
if ($http->hasPostVariable("SelectedNodeIDArray") and $http->postVariable("BrowseActionName") == "FindLimitationSubtree" and !$http->hasPostVariable('BrowseCancelButton')) {
$selectedSubtreeIDList = $http->postVariable("SelectedNodeIDArray");
$db = eZDB::instance();
$db->begin();
if ($subtreeLimitation == null) {
$subtreeLimitation = eZPolicyLimitation::createNew($policyID, "Subtree", $currentModule, $currentFunction);
}
foreach ($selectedSubtreeIDList as $nodeID) {
if (!isset($subtreeIDList) or !in_array($nodeID, $subtreeIDList)) {
$subtree = eZContentObjectTreeNode::fetch($nodeID);
$pathString = $subtree->attribute('path_string');
$policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
$subtreeList[] = $subtree;
}
}
$db->commit();
}
$currentLimitationList = array();
foreach ($currentFunctionLimitations as $currentFunctionLimitation) {
$currentLimitationList[$currentFunctionLimitation['name']] = "-1";
}