CBlogPost :: GetSocNetGroups: Bitrix method

      
<?php 
//  CBlogPost :: GetSocNetGroups()
//  /dist/bitrix/modules/blog/general/blog_post.php:1269

    
public static function GetSocNetGroups($entity_type$entity_id$operation "view_post")
    {
        
$entity_id IntVal($entity_id);
        if(
$entity_id <= 0)
            return 
false;
        if(!
CModule::IncludeModule("socialnetwork"))
            return 
false;
        
$feature "blog";

        
$arResult = array();

        if(
$entity_type == "G")
        {
            
$prefix "SG".$entity_id."_";
            
$letter CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_GROUP$entity_id$feature$operation);
            
$arResult array_merge($arResultself::getFullGroupRoleSet($letter$prefix));
        }
        else
        {
            
$prefix "SU".$entity_id."_";
            
$letter CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_USER$entity_id$feature$operation);
            switch(
$letter)
            {
                case 
"A"://All
                    
$arResult[] = 'G2';
                    break;
                case 
"C"://Authorized
                    
$arResult[] = 'AU';
                    break;
                case 
"E"://Friends of friends (has no rights yet) so it counts as
                
case "M"://Friends
                    
$arResult[] = $prefix.'M';
                    break;
                case 
"Z"://Personal
                    
$arResult[] = $prefix.'Z';
                    break;
            }
        }

        return 
$arResult;
    }