當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TaskPermission::canAccessTaskPermissions方法代碼示例

本文整理匯總了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());
     }
 }
開發者ID:ricardomccerqueira,項目名稱:rcerqueira.portfolio,代碼行數:25,代碼來源:tasks.php

示例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());
     }
 }
開發者ID:ricardomccerqueira,項目名稱:rcerqueira.portfolio,代碼行數:25,代碼來源:files.php

示例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');
 }
開發者ID:VonUniGE,項目名稱:concrete5-1,代碼行數:16,代碼來源:controller.php

示例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 
}
?>
開發者ID:yakamoz-fang,項目名稱:concrete,代碼行數:31,代碼來源:permissions.php


注:本文中的TaskPermission::canAccessTaskPermissions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。