当前位置: 首页>>代码示例>>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;未经允许,请勿转载。