本文整理匯總了PHP中TaskPermission::canAccessTaskPermissions方法的典型用法代碼示例。如果您正苦於以下問題:PHP TaskPermission::canAccessTaskPermissions方法的具體用法?PHP TaskPermission::canAccessTaskPermissions怎麽用?PHP TaskPermission::canAccessTaskPermissions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TaskPermission
的用法示例。
在下文中一共展示了TaskPermission::canAccessTaskPermissions方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
public function save()
{
if (Loader::helper('validation/token')->validate('save_permissions')) {
$tp = new TaskPermission();
if ($tp->canAccessTaskPermissions()) {
$permissions = PermissionKey::getList('sitemap');
$permissions = array_merge($permissions, PermissionKey::getList('marketplace_newsflow'));
$permissions = array_merge($permissions, PermissionKey::getList('admin'));
foreach ($permissions as $pk) {
$paID = $_POST['pkID'][$pk->getPermissionKeyID()];
$pt = $pk->getPermissionAssignmentObject();
$pt->clearPermissionAssignment();
if ($paID > 0) {
$pa = PermissionAccess::getByID($paID, $pk);
if (is_object($pa)) {
$pt->assignPermissionAccess($pa);
}
}
}
$this->redirect('/dashboard/system/permissions/tasks', 'updated');
}
} else {
$this->error->add(Loader::helper("validation/token")->getErrorMessage());
}
}
示例2: save
public function save()
{
if (Loader::helper('validation/token')->validate('save_permissions')) {
$fs = FileSet::getGlobal();
$tp = new TaskPermission();
if ($tp->canAccessTaskPermissions()) {
$permissions = PermissionKey::getList('file_set');
foreach ($permissions as $pk) {
$pk->setPermissionObject($fs);
$paID = $_POST['pkID'][$pk->getPermissionKeyID()];
$pt = $pk->getPermissionAssignmentObject();
$pt->clearPermissionAssignment();
if ($paID > 0) {
$pa = PermissionAccess::getByID($paID, $pk);
if (is_object($pa)) {
$pt->assignPermissionAccess($pa);
}
}
}
$this->redirect('/dashboard/system/permissions/files', 'updated');
}
} else {
$this->error->add(Loader::helper("validation/token")->getErrorMessage());
}
}
示例3: save_task_permissions
public function save_task_permissions()
{
if (!$this->token->validate("update_permissions")) {
$this->set('error', array($this->token->getErrorMessage()));
return;
}
$tp = new TaskPermission();
if (!$tp->canAccessTaskPermissions()) {
$this->set('error', array(t('You do not have permission to modify these items.')));
return;
}
$post = $this->post();
$h = Loader::helper('concrete/dashboard/task_permissions');
$h->save($post);
$this->redirect('/dashboard/settings/', 'set_permissions', 'task_permissions_saved');
}
示例4: TaskPermission
?>
<?php
$fs = FileSet::getGlobal();
?>
<form method="post" action="<?php
echo $view->action('save');
?>
" id="ccm-permission-list-form">
<?php
echo Loader::helper('validation/token')->output('save_permissions');
?>
<div class="ccm-pane-body">
<?php
$tp = new TaskPermission();
if ($tp->canAccessTaskPermissions()) {
?>
<?php
Loader::element('permission/lists/file_set', array('fs' => $fs));
?>
<?php
} else {
?>
<p><?php
echo t('You cannot access task permissions.');
?>
</p>
<?php
}
?>