CBPWorkflowTemplateUser :: __construct: Bitrix method

      
<?php 
//  CBPWorkflowTemplateUser :: __construct()
//  /dist/bitrix/modules/bizproc/classes/general/workflowtemplateloader.php:1203

    
public function __construct($userId null)
    {
        
$this->userId 0;
        
$this->isAdmin false;
        
$this->fullName '';

        if (
is_int($userId))
        {
            
$userGroups CUser::GetUserGroup($userId);
            
$this->userId = (int)$userId;
            
$this->isAdmin in_array(1$userGroups);
        }
        elseif (
$userId === self::CurrentUser)
        {
            global 
$USER;
            if (
is_object($USER) && $USER->IsAuthorized())
            {
                
$this->userId = (int)$USER->GetID();
                
$this->isAdmin = (
                    
$USER->IsAdmin()
                    || 
CModule::IncludeModule('bitrix24') && CBitrix24::IsPortalAdmin($USER->GetID())
                );
                
$this->fullName $USER->GetFullName();
            }
        }
    }