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


PHP UserRights::SelectModule方法代碼示例

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


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

示例1: array_keys

                $aRes = array_keys($this->m_aUserProfiles[$iUser]);
            } else {
                // no profile has been defined for this user
                $aRes = array();
            }
        } else {
            $aProfileRes = array();
            foreach ($this->m_aDimensions as $iDimension => $oDimension) {
                foreach ($this->GetMatchingProfilesByDim($oUser, $oObject, $oDimension) as $iProfile) {
                    @($aProfileRes[$iProfile] += 1);
                }
            }
            $aRes = array();
            $iDimCount = count($this->m_aDimensions);
            foreach ($aProfileRes as $iProfile => $iMatches) {
                if ($iMatches == $iDimCount) {
                    $aRes[] = $iProfile;
                }
            }
        }
        // store into the cache
        $this->m_aMatchingProfiles[$iUser][$sClass][$iObjectRef] = $aRes;
        return $aRes;
    }
    public function FlushPrivileges()
    {
        $this->CacheData();
    }
}
UserRights::SelectModule('UserRightsProjection');
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:30,代碼來源:userrightsprojection.class.inc.php

示例2: IsStimulusAllowed

            case 'no':
            default:
                $iRetCode = UR_ALLOWED_NO;
                break;
        }
        return $iRetCode;
    }
    public function IsStimulusAllowed($oUser, $sClass, $sStimulusCode, $oInstanceSet = null)
    {
        $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassStimulusGrant WHERE class = '{$sClass}' AND stimulus = '{$sStimulusCode}' AND userid = '{$oUser->GetKey()}'"));
        if ($oSet->Count() < 1) {
            return UR_ALLOWED_NO;
        }
        $oGrantRecord = $oSet->Fetch();
        switch ($oGrantRecord->Get('permission')) {
            case 'yes':
                $iRetCode = UR_ALLOWED_YES;
                break;
            case 'no':
            default:
                $iRetCode = UR_ALLOWED_NO;
                break;
        }
        return $iRetCode;
    }
    public function FlushPrivileges()
    {
    }
}
UserRights::SelectModule('UserRightsMatrix');
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:30,代碼來源:userrightsmatrix.class.inc.php

示例3: array

    {
        $sAttCode = null;
        $aCallSpec = array($sClass, 'MapContextParam');
        if ($sClass == 'Organization' || is_subclass_of($sClass, 'Organization')) {
            $sAttCode = 'id';
        } elseif (is_callable($aCallSpec)) {
            $sAttCode = call_user_func($aCallSpec, 'org_id');
            // Returns null when there is no mapping for this parameter
            if (!MetaModel::IsValidAttCode($sClass, $sAttCode)) {
                // Skip silently. The data model checker will tell you something about this...
                $sAttCode = null;
            }
        } elseif (MetaModel::IsValidAttCode($sClass, 'org_id')) {
            $sAttCode = 'org_id';
        }
        return $sAttCode;
    }
    /**
     * Determine wether the objects can be shared by the mean of a class SharedObject
     **/
    protected static function HasSharing()
    {
        static $bHasSharing;
        if (!isset($bHasSharing)) {
            $bHasSharing = class_exists('SharedObject');
        }
        return $bHasSharing;
    }
}
UserRights::SelectModule('UserRightsProfile');
開發者ID:kira8565,項目名稱:ITOP203-ZHCN,代碼行數:30,代碼來源:userrightsprofile.class.inc.php

示例4: IsPortalUser

    public function IsPortalUser($oUser)
    {
        return true;
    }
    public function Init()
    {
        return true;
    }
    public function GetSelectFilter($oUser, $sClass, $aSettings = array())
    {
        $oNullFilter = new DBObjectSearch($sClass);
        return $oNullFilter;
    }
    public function IsActionAllowed($oUser, $sClass, $iActionCode, $oInstanceSet = null)
    {
        return UR_ALLOWED_YES;
    }
    public function IsStimulusAllowed($oUser, $sClass, $sStimulusCode, $oInstanceSet = null)
    {
        return UR_ALLOWED_YES;
    }
    public function IsActionAllowedOnAttribute($oUser, $sClass, $sAttCode, $iActionCode, $oInstanceSet = null)
    {
        return UR_ALLOWED_YES;
    }
    public function FlushPrivileges()
    {
    }
}
UserRights::SelectModule('UserRightsNull');
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:30,代碼來源:userrightsnull.class.inc.php


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