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


PHP UserRights::GetModuleInstance方法代碼示例

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


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

示例1: DoShowGrantSumary

 function DoShowGrantSumary($oPage)
 {
     if ($this->GetRawName() == "Administrator") {
         // Looks dirty, but ok that's THE ONE
         $oPage->p(Dict::S('UI:UserManagement:AdminProfile+'));
         return;
     }
     // Note: for sure, we assume that the instance is derived from UserRightsProjection
     $oUserRights = UserRights::GetModuleInstance();
     $aDisplayData = array();
     foreach (MetaModel::GetClasses('bizmodel') as $sClass) {
         // Skip non instantiable classes
         if (MetaModel::IsAbstract($sClass)) {
             continue;
         }
         $aStimuli = array();
         foreach (MetaModel::EnumStimuli($sClass) as $sStimulusCode => $oStimulus) {
             $oGrant = $oUserRights->GetClassStimulusGrant($this->GetKey(), $sClass, $sStimulusCode);
             if (is_object($oGrant) && $oGrant->Get('permission') == 'yes') {
                 $aStimuli[] = '<span title="' . $sStimulusCode . ': ' . htmlentities($oStimulus->GetDescription(), ENT_QUOTES, 'UTF-8') . '">' . htmlentities($oStimulus->GetLabel(), ENT_QUOTES, 'UTF-8') . '</span>';
             }
         }
         $sStimuli = implode(', ', $aStimuli);
         $aDisplayData[] = array('class' => MetaModel::GetName($sClass), 'read' => $this->GetGrantAsHtml($oUserRights, $sClass, 'Read'), 'bulkread' => $this->GetGrantAsHtml($oUserRights, $sClass, 'Bulk Read'), 'write' => $this->GetGrantAsHtml($oUserRights, $sClass, 'Modify'), 'bulkwrite' => $this->GetGrantAsHtml($oUserRights, $sClass, 'Bulk Modify'), 'delete' => $this->GetGrantAsHtml($oUserRights, $sClass, 'Delete'), 'bulkdelete' => $this->GetGrantAsHtml($oUserRights, $sClass, 'Bulk Delete'), 'stimuli' => $sStimuli);
     }
     $aDisplayConfig = array();
     $aDisplayConfig['class'] = array('label' => Dict::S('UI:UserManagement:Class'), 'description' => Dict::S('UI:UserManagement:Class+'));
     $aDisplayConfig['read'] = array('label' => Dict::S('UI:UserManagement:Action:Read'), 'description' => Dict::S('UI:UserManagement:Action:Read+'));
     $aDisplayConfig['bulkread'] = array('label' => Dict::S('UI:UserManagement:Action:BulkRead'), 'description' => Dict::S('UI:UserManagement:Action:BulkRead+'));
     $aDisplayConfig['write'] = array('label' => Dict::S('UI:UserManagement:Action:Modify'), 'description' => Dict::S('UI:UserManagement:Action:Modify+'));
     $aDisplayConfig['bulkwrite'] = array('label' => Dict::S('UI:UserManagement:Action:BulkModify'), 'description' => Dict::S('UI:UserManagement:Action:BulkModify+'));
     $aDisplayConfig['delete'] = array('label' => Dict::S('UI:UserManagement:Action:Delete'), 'description' => Dict::S('UI:UserManagement:Action:Delete+'));
     $aDisplayConfig['bulkdelete'] = array('label' => Dict::S('UI:UserManagement:Action:BulkDelete'), 'description' => Dict::S('UI:UserManagement:Action:BulkDelete+'));
     $aDisplayConfig['stimuli'] = array('label' => Dict::S('UI:UserManagement:Action:Stimuli'), 'description' => Dict::S('UI:UserManagement:Action:Stimuli+'));
     $oPage->table($aDisplayConfig, $aDisplayData);
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:36,代碼來源:userrightsprojection.class.inc.php


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