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