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


PHP Users_Privileges_Model::getSharedOwner方法代碼示例

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


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

示例1: isPermitted


//.........這裏部分代碼省略.........
            $permission = "no";
            $log->debug("Exiting isPermitted method ...");
            return $permission;
        }
        //Checking for Action Permission
        if (strlen($profileActionPermission[$tabid][$actionid]) < 1 && $profileActionPermission[$tabid][$actionid] == '') {
            $permission = "yes";
            $log->debug("Exiting isPermitted method ...");
            return $permission;
        }
        if ($profileActionPermission[$tabid][$actionid] != 0 && $profileActionPermission[$tabid][$actionid] != '') {
            $permission = "no";
            $log->debug("Exiting isPermitted method ...");
            return $permission;
        }
        //Checking and returning true if recorid is null
        if ($record_id == '') {
            $permission = "yes";
            $log->debug("Exiting isPermitted method ...");
            return $permission;
        }
        //If modules is Products,Vendors,Faq,PriceBook then no sharing
        if ($record_id != '') {
            if (getTabOwnedBy($module) == 1) {
                $permission = "yes";
                $log->debug("Exiting isPermitted method ...");
                return $permission;
            }
        }
        //Retreiving the RecordOwnerId
        $recOwnType = '';
        $recOwnId = '';
        $recordOwnerArr = getRecordOwnerId($record_id);
        $shownerids = Users_Privileges_Model::getSharedOwner($record_id);
        foreach ($recordOwnerArr as $type => $id) {
            $recOwnType = $type;
            $recOwnId = $id;
        }
        //Retreiving the default Organisation sharing Access
        $others_permission_id = $defaultOrgSharingPermission[$tabid];
        if ($recOwnType == 'Users') {
            //Checking if the Record Owner is the current User
            if ($current_user->id == $recOwnId || in_array($current_user->id, $shownerids)) {
                $permission = "yes";
                $log->debug("Exiting isPermitted method ...");
                return $permission;
            }
            //Checking if the Record Owner is the Subordinate User
            foreach ($subordinate_roles_users as $roleid => $userids) {
                if (in_array($recOwnId, $userids)) {
                    $permission = 'yes';
                    if ($module == 'Calendar') {
                        $permission = isCalendarPermittedBySharing($record_id);
                    }
                    $log->debug("Exiting isPermitted method ...");
                    return $permission;
                }
            }
        } elseif ($recOwnType == 'Groups') {
            //Checking if the record owner is the current user's group
            if (in_array($recOwnId, $current_user_groups)) {
                $permission = 'yes';
                $log->debug("Exiting isPermitted method ...");
                return $permission;
            }
        }
開發者ID:rcrrich,項目名稱:UpdatePackages,代碼行數:67,代碼來源:UserInfoUtil.php


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