本文整理汇总了PHP中OA_Permission::isUserLinkedToAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Permission::isUserLinkedToAccount方法的具体用法?PHP OA_Permission::isUserLinkedToAccount怎么用?PHP OA_Permission::isUserLinkedToAccount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA_Permission
的用法示例。
在下文中一共展示了OA_Permission::isUserLinkedToAccount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _validateDefaultAccount
/**
* This method performs data validation for the default account ID
*
* @param OA_Dll_UserInfo $oUser
* @return boolean
*/
function _validateDefaultAccount($oUser)
{
if (!OA_Permission::isUserLinkedToAccount($oUser->defaultAccountId, $oUser->userId)) {
$this->raiseError(self::ERROR_DEFAULT_ACC_NOT_LINKED);
return false;
}
return true;
}
示例2: _validateDefaultAccount
/**
* This method performs data validation for the default account ID
*
* @param OA_Dll_UserInfo $oUser
* @return boolean
*/
function _validateDefaultAccount($oUser)
{
if (!OA_Permission::isUserLinkedToAccount($oUser->defaultAccountId, $oUser->userId)) {
$this->raiseError('The specified default account is not linked to the user');
return false;
}
return true;
}
示例3: linkUserToAccount
/**
* Links user with account and set apropriate messages.
* Common method reused across user access pages
*
* @param integer $userId User ID
* @param integer $accountId Account ID
* @param array $permissions Array of permissions
* @param array $aAllowedPermissions Array of allowed permissions
*/
function linkUserToAccount($userId, $accountId, $permissions, $aAllowedPermissions)
{
if (!empty($userId)) {
if (!OA_Permission::isUserLinkedToAccount($accountId, $userId)) {
OA_Session::setMessage($GLOBALS['strUserLinkedToAccount']);
} else {
OA_Session::setMessage($GLOBALS['strUserAccountUpdated']);
}
OA_Permission::setAccountAccess($accountId, $userId);
OA_Permission::storeUserAccountsPermissions($permissions, $accountId, $userId, $aAllowedPermissions);
}
}
示例4: hasAccess
/**
* A method to check if the user has access to a specific account
*
* User cuold either has direct access to account or indirect.
* Indirect access could be in case if user has access to one of the parent
* entities.
*
* @static
* @param int $accountId
* @return boolean
*/
function hasAccess($accountId, $userId = null)
{
if (empty($userId)) {
$userId = OA_Permission::getUserId();
}
return OA_Permission::isUserLinkedToAccount($accountId, $userId) || OA_Permission::isUserLinkedToAdmin($userId);
}