Switch landing.role.enable Models

We are still updating this page

Some data may be missing here — we will complete it shortly.

Scope: landing

Who can execute the method: administrator

The method landing.role.enable switches between the extended and role-based models.

Examples

try
        {
        	const response = await $b24.callMethod(
        		'landing.role.enable',
        		{
        			mode: 1 // 1 – to enable the role-based model, 0 – to disable (enable the extended model)
        		}
        	);
        	
        	const result = response.getData().result;
        	console.info(result);
        }
        catch(error)
        {
        	console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.role.enable',
                    [
                        'mode' => 1, // 1 – to enable the role-based model, 0 – to disable (enable the extended model)
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                error_log($result->error());
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error enabling landing role: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.role.enable',
            {
                mode: 1 // 1 – to enable the role-based model, 0 – to disable (enable the extended model)
            },
            function(result)
            {
                if(result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.info(result.data());
                }
            }
        );
        

How to Use Examples in Documentation