本文整理汇总了PHP中Manager::checkAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::checkAccess方法的具体用法?PHP Manager::checkAccess怎么用?PHP Manager::checkAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager::checkAccess方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
$this->data->isMaster = Manager::checkAccess('MASTER', A_EXECUTE) ? 'true' : 'false';
$editor = MApp::getService('fnbr20', '', 'visualeditor');
$this->data->relationData = $editor->getRelationData();
$this->data->relationEntry = json_encode($this->data->relationData);
$this->render();
}
示例2: saveCERelation
public function saveCERelation()
{
$isMaster = Manager::checkAccess('MASTER', A_EXECUTE);
$editor = MApp::getService('fnbr20', '', 'visualeditor');
if ($isMaster) {
$editor->updateCERelation($this->data->graphceJson);
$editor->deleteCERelation($this->data->linksceRemoved);
$this->renderPrompt('info', 'Ok');
} else {
$this->renderPrompt('error', 'Error');
}
}
示例3: getLayersData
public function getLayersData($idSentence)
{
if (!\Manager::checkAccess('MASTER', A_EXECUTE)) {
$condition = "AND (AnnotationSet.idAnnotationSet = {$this->getId()})";
}
$idLanguage = \Manager::getSession()->idLanguage;
$cmd = <<<HERE
SELECT AnnotationSet.idAnnotationSet,
l.idLayerType,
l.idLayer,
entry_lt.name AS layer,
ifnull(lb.startChar,-1) AS startChar,
ifnull(lb.endChar,-1) AS endChar,
ifnull(gl.idEntity, ifnull(fe.idEntity, ce.idEntity)) AS idLabelType,
lb.idLabel,
lt.entry as layerTypeEntry
FROM AnnotationSet
INNER JOIN Layer l
ON (AnnotationSet.idAnnotationSet = l.idAnnotationSet)
LEFT JOIN Label lb
ON (l.idLayer=lb.idLayer)
LEFT JOIN GenericLabel gl
ON (lb.idLabelType=gl.idEntity)
LEFT JOIN FrameElement fe
ON (lb.idLabelType=fe.idEntity)
LEFT JOIN Entry entry_fe
ON (fe.entry = entry_fe.entry)
LEFT JOIN ConstructionElement ce
ON (lb.idLabelType=ce.idEntity)
LEFT JOIN Entry entry_ce
ON (ce.entry = entry_ce.entry)
INNER JOIN LayerType lt
ON (l.idLayerType=lt.idLayerType)
INNER JOIN Entry entry_lt
ON (lt.entry = entry_lt.entry)
WHERE ((entry_lt.idLanguage = {$idLanguage} )
AND ((gl.idLanguage = {$idLanguage}) or (gl.idLanguage is null))
AND ((entry_fe.idLanguage = {$idLanguage}) or (entry_fe.idLanguage is null))
{$condition} AND (AnnotationSet.idSentence = {$idSentence} ))
ORDER BY AnnotationSet.idAnnotationSet, lt.order, entry_lt.name, l.idLayer, ifnull(lb.startChar,-1)
HERE;
$query = $this->getDb()->getQueryCommand($cmd);
return $query;
}
示例4: main
public function main()
{
$this->data->isMaster = Manager::checkAccess('MASTER', A_EXECUTE) ? 'true' : 'false';
$this->render();
}
示例5: checkAccess
public function checkAccess()
{
$result = true;
$access = $this->getAccess();
if ($access && Manager::isLogged()) {
$perms = explode(':', $access);
$right = Manager::getPerms()->getRight($perms[1]);
$result = Manager::checkAccess($perms[0], $right);
}
return $result;
}
示例6: addGroupActions
public function addGroupActions($transaction, $access, $label, $actions)
{
if (Manager::checkAccess($transaction, $access)) {
$this->addBreak();
$this->addControl(new MLabel($label, '', true));
$this->addBreak();
$this->addControl(new MSeparator());
$this->addActions($actions);
}
}
示例7: formCorpusAnnotation
public function formCorpusAnnotation()
{
$annotation = MApp::getService('fnbr20', '', 'annotation');
$this->data->isMaster = Manager::checkAccess('MASTER', A_EXECUTE) ? 'true' : 'false';
$this->data->isSenior = Manager::checkAccess('SENIOR', A_EXECUTE) ? 'true' : 'false';
$this->data->colors = $annotation->getColor();
$this->data->layerType = $annotation->getLayerType();
$it = $annotation->getInstantiationType();
$this->data->instantiationType = $it['array'];
$this->data->instantiationTypeObj = $it['obj'];
$this->render();
}
示例8: handleChildren
private function handleChildren($control, $node, $addMethod = 'addControl')
{
$context = $this->localContext;
foreach ($node->children() as $i => $n) {
if ($this->ignoreElement($n)) {
continue;
}
$e = array();
if ($i == 'event') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = trim(utf8_decode((string) $value));
}
$control->addEvent($e['event'], $e['handler'], $e['preventDefault'] === 'true');
} elseif ($i == 'ajax') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = trim(utf8_decode((string) $value));
}
$url = $this->processValue($e['url']);
$control->ajax($e['type'], $e['event'], $url, $e['load'], $e['preventDefault'] === 'true');
} elseif ($i == 'data') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = trim(utf8_decode((string) $value));
}
if ($e['load']) {
$value = str_replace("\$this", "\$context", $e['load']);
$control->setData(eval('return ' . $value . ';'));
}
if ($e['id']) {
$id = $e['id'];
$control->data->{$id} = $this->processValue($e['value']);
}
} elseif ($i == 'property') {
foreach ($n->attributes() as $property => $value) {
$control->{$property} = $this->processValue($value);
}
} elseif ($i == 'attribute') {
foreach ($n->attributes() as $property => $value) {
$control->addAttribute($property, $this->processValue($value));
}
} elseif ($i == 'include') {
$this->getControlsFromInclude($n, $control, true);
} elseif ($i == 'fields') {
$fields = $this->getControlsFromDOM($n);
$control->addFields($fields);
} elseif ($i == 'buttons') {
$buttons = $this->getControlsFromDOM($n);
$control->addButtons($buttons);
} elseif ($i == 'auth') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = trim(utf8_decode((string) $value));
}
$perms = explode(':', $e['access']);
$right = Manager::getPerms()->getRight($perms[1]);
$ok = Manager::checkAccess($perms[0], $right);
if ($ok) {
$this->handleChildren($control, $n, $addMethod);
}
} elseif ($i == 'help') {
$fields = $this->getControlsFromDOM($n);
$control->addFields($fields);
} elseif ($i == 'validators') {
$validators = $this->getControlsFromDOM($n);
$control->setValidators($validators);
} elseif ($i == 'controls') {
$controls = $this->getControlsFromDOM($n);
$control->setControls($controls);
} elseif ($i == 'actions') {
$controls = $this->getControlsFromDOM($n);
$control->addAction($controls);
} elseif ($i == 'action') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = $this->processValue($value);
}
$control->addAction($e['action'], $e['label'], $e['transaction'], $e['access']);
} elseif ($i == 'tool') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = $this->processValue(trim(utf8_decode((string) $value)));
}
$control->addTool($e['title'], $e['action'], $e['icon']);
} elseif ($i == 'method') {
foreach ($n->attributes() as $property => $value) {
$e[$property] = trim(utf8_decode((string) $value));
}
$func = create_function($e['args'], trim(utf8_decode((string) $n[0])));
$name = $e['name'];
$control->{$name} = $func;
} elseif ($i == 'css') {
$this->handleNodeCSS($n);
} elseif ($i == 'javascript') {
$this->handleNodeJavascript($n);
} else {
$obj = $control->instance($i);
if ($obj instanceof MValidator) {
$control->setValidator($obj);
} else {
$obj->context = $control->context;
$this->getControlFromDOM($obj, $n);
$control->{$addMethod}($obj);
}
}
//.........这里部分代码省略.........
示例9: addUserAction
public function addUserAction($transaction, $access, $label, $action = '')
{
if (Manager::checkAccess($transaction, $access)) {
$this->actions[$action] = $label;
}
}