本文整理汇总了PHP中PermissionKey::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP PermissionKey::getList方法的具体用法?PHP PermissionKey::getList怎么用?PHP PermissionKey::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PermissionKey
的用法示例。
在下文中一共展示了PermissionKey::getList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
}
示例2: 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());
}
}
示例3: parseManual
/**
* @see \C5TL\Parser\DynamicItem::parseManual()
*/
public function parseManual(\Gettext\Translations $translations, $concrete5version)
{
if (class_exists('\\PermissionKeyCategory', true) && method_exists('\\PermissionKeyCategory', 'getList')) {
foreach (\PermissionKeyCategory::getList() as $pkc) {
$pkcHandle = $pkc->getPermissionKeyCategoryHandle();
foreach (\PermissionKey::getList($pkcHandle) as $pk) {
$this->addTranslation($translations, $pk->getPermissionKeyName(), 'PermissionKeyName');
$this->addTranslation($translations, $pk->getPermissionKeyDescription(), 'PermissionKeyDescription');
}
}
}
}
示例4: updateDetails
public function updateDetails($post) {
$permissions = PermissionKey::getList('basic_workflow');
foreach($permissions as $pk) {
$pk->setPermissionObject($this);
$pt = $pk->getPermissionAssignmentObject();
$paID = $post['pkID'][$pk->getPermissionKeyID()];
$pt->clearPermissionAssignment();
if ($paID > 0) {
$pa = PermissionAccess::getByID($paID, $pk);
if (is_object($pa)) {
$pt->assignPermissionAccess($pa);
}
}
}
}
示例5: approve
public function approve(WorkflowProgress $wp)
{
$c = Page::getByID($this->getRequestedPageID());
$permissions = PermissionKey::getList('page');
$ps = $this->getPagePermissionSet();
$assignments = $ps->getPermissionAssignments();
foreach ($permissions as $pk) {
$paID = $assignments[$pk->getPermissionKeyID()];
$pk->setPermissionObject($c);
$pt = $pk->getPermissionAssignmentObject();
$pt->clearPermissionAssignment();
if ($paID > 0) {
$pa = PermissionAccess::getByID($paID, $pk);
if (is_object($pa)) {
$pt->assignPermissionAccess($pa);
}
}
}
$c->refreshCache();
$wpr = new WorkflowProgressResponse();
$wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID());
return $wpr;
}
示例6:
<?php
$cat = PermissionKeyCategory::getByHandle($handle);
?>
<form method="post" id="ccm-permission-list-form" action="<?php
echo $cat->getToolsURL("save_permission_assignments");
?>
&treeNodeID=<?php
echo $node->getTreeNodeID();
?>
">
<table class="ccm-permission-grid table table-striped">
<?php
$permissions = PermissionKey::getList($handle);
foreach ($permissions as $pk) {
$pk->setPermissionObject($node);
?>
<tr>
<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php
echo $pk->getPermissionKeyID();
?>
"><strong><?php
if ($enablePermissions) {
?>
<a dialog-title="<?php
echo $pk->getPermissionKeyDisplayName();
?>
" data-pkID="<?php
echo $pk->getPermissionKeyID();
示例7: array
$pe = PermissionAccessEntity::getByID($_REQUEST['peID']);
$pa->removeListItem($pe);
}
if ($_REQUEST['task'] == 'save_permission' && Loader::helper("validation/token")->validate('save_permission')) {
$pk = AreaPermissionKey::getByID($_REQUEST['pkID']);
$pk->setPermissionObject($ax);
$pa = PermissionAccess::getByID($_REQUEST['paID'], $pk);
$pa->save($_POST);
}
if ($_REQUEST['task'] == 'display_access_cell' && Loader::helper("validation/token")->validate('display_access_cell')) {
$pk = PermissionKey::getByID($_REQUEST['pkID']);
$pa = PermissionAccess::getByID($_REQUEST['paID'], $pk);
Loader::element('permission/labels', array('pk' => $pk, 'pa' => $pa));
}
if ($_REQUEST['task'] == 'save_permission_assignments' && Loader::helper("validation/token")->validate('save_permission_assignments')) {
$permissions = PermissionKey::getList('area');
foreach ($permissions as $pk) {
$paID = $_POST['pkID'][$pk->getPermissionKeyID()];
$pk->setPermissionObject($ax);
$pt = $pk->getPermissionAssignmentObject();
$pt->clearPermissionAssignment();
if ($paID > 0) {
$pa = PermissionAccess::getByID($paID, $pk);
if (is_object($pa)) {
$pt->assignPermissionAccess($pa);
}
}
}
}
}
}
示例8: file_sets_edit
public function file_sets_edit(){
extract($this->getHelperObjects());
Loader::model('file_set');
//do my editing
if (!$validation_token->validate("file_sets_edit")) {
$this->set('error', array($validation_token->getErrorMessage()));
$this->view();
return;
}
if(!$this->post('fsID')){
$this->set('error', array(t('Invalid ID')));
$this->view();
}
$file_set = new FileSet();
$file_set->Load('fsID = ?', $this->post('fsID'));
$file_set->fsName = $this->post('file_set_name');
$copyPermissionsFromBase = false;
if ($file_set->fsOverrideGlobalPermissions == 0 && $this->post('fsOverrideGlobalPermissions') == 1) {
// we are checking the checkbox for the first time
$copyPermissionsFromBase = true;
}
if ($file_set->fsOverrideGlobalPermissions) {
$permissions = PermissionKey::getList('file_set');
foreach($permissions as $pk) {
$pk->setPermissionObject($file_set);
$pt = $pk->getPermissionAssignmentObject();
$paID = $_POST['pkID'][$pk->getPermissionKeyID()];
$pt->clearPermissionAssignment();
if ($paID > 0) {
$pa = PermissionAccess::getByID($paID, $pk);
if (is_object($pa)) {
$pt->assignPermissionAccess($pa);
}
}
}
}
$file_set->fsOverrideGlobalPermissions = ($this->post('fsOverrideGlobalPermissions') == 1) ? 1 : 0;
$file_set->save();
parse_str($this->post('fsDisplayOrder'));
$file_set->updateFileSetDisplayOrder($fID);
if ($file_set->fsOverrideGlobalPermissions == 0) {
$file_set->resetPermissions();
}
if ($copyPermissionsFromBase) {
$file_set->acquireBaseFileSetPermissions();
}
$this->redirect("/dashboard/files/sets", 'view_detail', $this->post('fsID'), 'file_set_updated');
}
示例9: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>
<?php
$cat = PermissionKeyCategory::getByHandle('basic_workflow');
?>
<table class="ccm-permission-grid">
<?php
$permissions = PermissionKey::getList('basic_workflow');
foreach ($permissions as $pk) {
$pk->setPermissionObject($workflow);
?>
<tr>
<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php
echo $pk->getPermissionKeyID();
?>
"><strong><?php
if ($enablePermissions) {
?>
<a dialog-title="<?php
echo $pk->getPermissionKeyDisplayName();
?>
" data-pkID="<?php
echo $pk->getPermissionKeyID();
?>
" data-paID="<?php
echo $pk->getPermissionAccessID();
?>
示例10: foreach
?>
<div class="<?php
if ($task == 'bulk_add_access') {
?>
form-inline<?php
}
?>
">
<table class="ccm-permission-grid table">
<tr>
<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-0">
<select name="pkID">
<?php
$permissions = PermissionKey::getList('page');
foreach ($permissions as $pk) {
?>
<option value="<?php
echo $pk->getPermissionKeyID();
?>
"><?php
echo $pk->getPermissionKeyDisplayName();
?>
</option>
<?php
}
?>
</select>
</td>
<td id="ccm-permission-grid-cell-0" class="ccm-permission-grid-cell-value" style="vertical-align: middle">
示例11: doOverrideAreaPermissions
public function doOverrideAreaPermissions() {
$db = Loader::db();
$c = $this->getBlockCollectionObject();
$v = array($c->getCollectionID(), $c->getVersionID(), $this->bID, $this->arHandle);
$db->query("update CollectionVersionBlocks set cbOverrideAreaPermissions = 1 where cID = ? and (cvID = ? or cbIncludeAll = 1) and bID = ? and arHandle = ?", $v);
$v = array($c->getCollectionID(), $c->getVersionID(), $this->bID);
$db->query("delete from BlockPermissionAssignments where cID = ? and cvID = ? and bID = ?", $v);
// copy permissions from the page to the area
$permissions = PermissionKey::getList('block');
foreach($permissions as $pk) {
$pk->setPermissionObject($this);
$pk->copyFromPageOrAreaToBlock();
}
$this->refreshCache();
}
示例12: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>
<table class="ccm-permission-grid table table-striped">
<?php
$permissions = PermissionKey::getList('sitemap');
$permissions = array_merge($permissions, PermissionKey::getList('marketplace_newsflow'));
$permissions = array_merge($permissions, PermissionKey::getList('admin'));
foreach ($permissions as $pk) {
?>
<tr>
<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php
echo $pk->getPermissionKeyID();
?>
"><strong><a dialog-title="<?php
echo $pk->getPermissionKeyDisplayName();
?>
" data-pkID="<?php
echo $pk->getPermissionKeyID();
?>
" data-paID="<?php
echo $pk->getPermissionAccessID();
?>
" onclick="ccm_permissionLaunchDialog(this)" href="javascript:void(0)"><?php
echo $pk->getPermissionKeyDisplayName();
?>
</a></strong></td>
<td id="ccm-permission-grid-cell-<?php
echo $pk->getPermissionKeyID();
示例13: exportList
public static function exportList($xml)
{
$categories = PermissionKeyCategory::getList();
$pxml = $xml->addChild('permissionkeys');
foreach ($categories as $cat) {
$permissions = PermissionKey::getList($cat->getPermissionKeyCategoryHandle());
foreach ($permissions as $p) {
$p->export($pxml);
}
}
}
示例14: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>
<?php
$cat = PermissionKeyCategory::getByHandle('conversation');
?>
<table class="ccm-permission-grid table table-striped">
<?php
$cnvID = 0;
if (is_object($conversation)) {
$cnvID = $conversation->getConversationID();
}
$permissions = PermissionKey::getList('conversation');
foreach ($permissions as $pk) {
$pk->setPermissionObject($conversation);
?>
<tr>
<td class="ccm-permission-grid-name" id="ccm-permission-grid-name-<?php
echo $pk->getPermissionKeyID();
?>
"><strong><a dialog-title="<?php
echo $pk->getPermissionKeyDisplayName();
?>
" data-pkID="<?php
echo $pk->getPermissionKeyID();
?>
" data-paID="<?php
echo $pk->getPermissionAccessID();
示例15: resetPermissions
public function resetPermissions($fOverrideSetPermissions = 0) {
$db = Loader::db();
$db->Execute("delete from FilePermissionAssignments where fID = ?", array($this->fID));
$db->Execute("update Files set fOverrideSetPermissions = ? where fID = ?", array($fOverrideSetPermissions, $this->fID));
if ($fOverrideSetPermissions) {
$permissions = PermissionKey::getList('file');
foreach($permissions as $pk) {
$pk->setPermissionObject($this);
$pk->copyFromFileSetToFile();
}
}
}