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


PHP Context::getPermissionDetails方法代碼示例

本文整理匯總了PHP中thebuggenie\core\framework\Context::getPermissionDetails方法的典型用法代碼示例。如果您正苦於以下問題:PHP Context::getPermissionDetails方法的具體用法?PHP Context::getPermissionDetails怎麽用?PHP Context::getPermissionDetails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在thebuggenie\core\framework\Context的用法示例。


在下文中一共展示了Context::getPermissionDetails方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: runGetBackdropPartial


//.........這裏部分代碼省略.........
                 break;
             case 'issue_subscribers':
                 $template_name = 'main/issuesubscribers';
                 break;
             case 'issue_spenttimes':
                 $template_name = 'main/issuespenttimes';
                 $options['initial_view'] = $request->getParameter('initial_view', 'list');
                 break;
             case 'issue_spenttime':
                 $template_name = 'main/issuespenttime';
                 $options['entry_id'] = $request->getParameter('entry_id');
                 break;
             case 'relate_issue':
                 $template_name = 'main/relateissue';
                 break;
             case 'project_build':
                 $template_name = 'project/build';
                 $options['project'] = entities\Project::getB2DBTable()->selectById($request['project_id']);
                 if ($request->hasParameter('build_id')) {
                     $options['build'] = entities\Build::getB2DBTable()->selectById($request['build_id']);
                 }
                 break;
             case 'project_icons':
                 $template_name = 'project/projecticons';
                 $options['project'] = entities\Project::getB2DBTable()->selectById($request['project_id']);
                 break;
             case 'project_workflow':
                 $template_name = 'project/projectworkflow';
                 $options['project'] = entities\Project::getB2DBTable()->selectById($request['project_id']);
                 break;
             case 'permissions':
                 $options['key'] = $request['permission_key'];
                 $target_module = $request['target_module'] !== 'core' ? $request['target_module'] : null;
                 if ($details = framework\Context::getPermissionDetails($options['key'], null, $target_module)) {
                     $template_name = 'configuration/permissionspopup';
                     $options['mode'] = $request['mode'];
                     $options['module'] = $request['target_module'];
                     $options['target_id'] = $request['target_id'];
                     $options['item_name'] = $details['description'];
                     $options['access_level'] = $request['access_level'];
                 }
                 break;
             case 'issuefield_permissions':
                 $options['item_key'] = $request['item_key'];
                 if ($details = framework\Context::getPermissionDetails($options['item_key'])) {
                     $template_name = 'configuration/issuefieldpermissions';
                     $options['item_name'] = $details['description'];
                     $options['item_id'] = $request['item_id'];
                     $options['access_level'] = $request['access_level'];
                 }
                 break;
             case 'site_icons':
                 $template_name = 'configuration/siteicons';
                 break;
             case 'project_config':
                 $template_name = 'project/projectconfig_container';
                 $project = entities\Project::getB2DBTable()->selectById($request['project_id']);
                 $options['project'] = $project;
                 $options['section'] = $request->getParameter('section', 'info');
                 if ($request->hasParameter('edition_id')) {
                     $edition = entities\Edition::getB2DBTable()->selectById($request['edition_id']);
                     $options['edition'] = $edition;
                     $options['selected_section'] = $request->getParameter('section', 'general');
                 }
                 break;
             case 'issue_add_item':
開發者ID:nrensen,項目名稱:thebuggenie,代碼行數:67,代碼來源:Main.php

示例2: foreach

<ul class="simple_list">
<?php 
if (count($role->getPermissions())) {
    ?>
    <?php 
    foreach ($role->getPermissions() as $permission) {
        ?>
        <?php 
        $permission_details = $permission->getModule() == 'core' ? \thebuggenie\core\framework\Context::getPermissionDetails($permission->getPermission()) : \thebuggenie\core\framework\Context::getModule($permission->getModule())->getPermissionDetails($permission->getPermission());
        ?>
        <li>
            <?php 
        echo image_tag('action_ok.png', array('style' => 'margin: 2px 5px -2px 0;'));
        echo array_key_exists('description', $permission_details) ? $permission_details['description'] : $permission;
        ?>
        </li>
    <?php 
    }
} else {
    ?>
    <li class="faded_out"><?php 
    echo __('This role does not have any associated permissions');
    ?>
</li>
<?php 
}
?>
</ul>
開發者ID:founderio,項目名稱:thebuggenie,代碼行數:28,代碼來源:_rolepermissionslist.inc.php


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