当前位置: 首页>>代码示例>>PHP>>正文


PHP PermissionsManager::searchByUgroupId方法代码示例

本文整理汇总了PHP中PermissionsManager::searchByUgroupId方法的典型用法代码示例。如果您正苦于以下问题:PHP PermissionsManager::searchByUgroupId方法的具体用法?PHP PermissionsManager::searchByUgroupId怎么用?PHP PermissionsManager::searchByUgroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PermissionsManager的用法示例。


在下文中一共展示了PermissionsManager::searchByUgroupId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getContent

 public function getContent()
 {
     $content = '<h2>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'permissions_title') . '</h2>';
     $this->permissions_manager = PermissionsManager::instance();
     $dar = $this->permissions_manager->searchByUgroupId($this->ugroup->getId());
     if ($dar && !$dar->isError() && $dar->rowCount() > 0) {
         $content .= '<p>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'ug_perms') . '<p>';
         $title_arr = array();
         $title_arr[] = $GLOBALS['Language']->getText('project_admin_editugroup', 'permission');
         $title_arr[] = $GLOBALS['Language']->getText('project_admin_editugroup', 'resource_name');
         $content .= '<table class="admin_permissions table table-bordered table-striped">';
         $content .= '<thead><tr>';
         $content .= '<th>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'permission') . '</th>';
         $content .= '<th>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'resource_name') . '</th>';
         $content .= '</tr></thead>';
         $content .= '<tbody>';
         $row_num = 0;
         foreach ($dar as $row) {
             if (strpos($row['permission_type'], 'TRACKER_FIELD') === 0) {
                 $atid = permission_extract_atid($row['object_id']);
                 if (isset($tracker_field_displayed[$atid])) {
                     continue;
                 }
                 $objname = permission_get_object_name('TRACKER_ACCESS_FULL', $atid);
             } else {
                 $objname = permission_get_object_name($row['permission_type'], $row['object_id']);
             }
             $content .= '<TR>';
             $content .= '<TD>' . permission_get_name($row['permission_type']) . '</TD>';
             if ($row['permission_type'] == 'PACKAGE_READ') {
                 $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'package') . ' <a href="/file/admin/editpackagepermissions.php?package_id=' . $row['object_id'] . '&group_id=' . $this->ugroup->getProjectId() . '">' . $objname . '</a></TD>';
             } else {
                 if ($row['permission_type'] == 'RELEASE_READ') {
                     $package_id = file_get_package_id_from_release_id($row['object_id']);
                     $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'release') . ' <a href="/file/admin/editreleasepermissions.php?release_id=' . $row['object_id'] . '&group_id=' . $this->ugroup->getProjectId() . '&package_id=' . $package_id . '">' . file_get_release_name_from_id($row['object_id']) . '</a> (' . $GLOBALS['Language']->getText('project_admin_editugroup', 'from_package') . ' <a href="/file/admin/editreleases.php?package_id=' . $package_id . '&group_id=' . $this->ugroup->getProjectId() . '">' . $objname . '</a></TD>';
                 } else {
                     if ($row['permission_type'] == 'DOCUMENT_READ') {
                         $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'document') . ' <a href="/docman/admin/editdocpermissions.php?docid=' . $row['object_id'] . '&group_id=' . $this->ugroup->getProjectId() . '">' . $objname . '</a></TD>';
                     } else {
                         if ($row['permission_type'] == 'DOCGROUP_READ') {
                             $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'document_group') . ' <a href="/docman/admin/editdocgrouppermissions.php?doc_group=' . $row['object_id'] . '&group_id=' . $this->ugroup->getProjectId() . '">' . $objname . '</a></TD>';
                         } else {
                             if ($row['permission_type'] == 'WIKI_READ') {
                                 $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'wiki') . ' <a href="/wiki/admin/index.php?view=wikiPerms&group_id=' . $this->ugroup->getProjectId() . '">' . $objname . '</a></TD>';
                             } else {
                                 if ($row['permission_type'] == 'WIKIPAGE_READ') {
                                     $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'wiki_page') . ' <a href="/wiki/admin/index.php?group_id=' . $this->ugroup->getProjectId() . '&view=pagePerms&id=' . $row['object_id'] . '">' . $objname . '</a></TD>';
                                 } else {
                                     if (strpos($row['permission_type'], 'TRACKER_ACCESS') === 0) {
                                         $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'tracker') . ' <a href="/tracker/admin/?func=permissions&perm_type=tracker&group_id=' . $this->ugroup->getProjectId() . '&atid=' . $row['object_id'] . '">' . $objname . '</a></TD>';
                                     } else {
                                         if (strpos($row['permission_type'], 'TRACKER_FIELD') === 0) {
                                             $tracker_field_displayed[$atid] = 1;
                                             $atid = permission_extract_atid($row['object_id']);
                                             $content .= '<TD>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'tracker_field') . ' <a href="/tracker/admin/?group_id=' . $this->ugroup->getProjectId() . '&atid=' . $atid . '&func=permissions&perm_type=fields&group_first=1&selected_id=' . $this->ugroup->getId() . '">' . $objname . '</a></TD>';
                                         } else {
                                             if ($row['permission_type'] == 'TRACKER_ARTIFACT_ACCESS') {
                                                 $content .= '<td>' . $this->html_purifier->purify($objname, CODENDI_PURIFIER_BASIC) . '</td>';
                                             } else {
                                                 $results = false;
                                                 $this->event_manager->processEvent('permissions_for_ugroup', array('permission_type' => $row['permission_type'], 'object_id' => $row['object_id'], 'objname' => $objname, 'group_id' => $this->ugroup->getProjectId(), 'ugroup_id' => $this->ugroup->getId(), 'results' => &$results));
                                                 if ($results) {
                                                     $content .= '<TD>' . $results . '</TD>';
                                                 } else {
                                                     $content .= '<TD>' . $row['object_id'] . '</TD>';
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             $content .= '</TR>';
             $row_num++;
         }
         $content .= '</tbody></table><p>';
     } else {
         $content .= '<p>' . $GLOBALS['Language']->getText('project_admin_editugroup', 'no_perms') . '.</p>';
     }
     return $content;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:84,代码来源:Permissions.class.php


注:本文中的PermissionsManager::searchByUgroupId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。