Coding standards
Security in ResourceSpace
Developer reference
Database
Mcp browse functions
Mcp report functions
Mcp management functions
Core feature functions
Embed functions

extension_enabled_for_group()

Description

Resolve a feature or plugin's activation in the pre-login or user group context.
An explicit group feature switch overrides the inherited preference and system default.

Parameters

ColumnTypeDefaultDescription
$record array Feature or plugin registry record.
$group: ?int
$group int|null User group reference, or null before login.

Return

bool Whether callbacks should run in this context.

Location

include/core_feature_functions.php lines 121 to 137

Definition

 
function extension_enabled_for_group(array $record, ?int $group): bool
{
    if (!isset(
$record['system_enabled'])) {
        return 
plugin_enabled_for_group(
            
$record['enabled_groups'],
            
$record['disable_group_select'] ?? in_array($record['name'], CORE_FEATURES_ALL_GROUPS, true),
            
$group
        
);
    }
    
$overrides = $record['group_options'];
    if (
$group === null || $group < 1 || $overrides === []) {
        return 
$record['system_enabled'];
    }
    return 
$overrides[$group]
        ?? 
$overrides[get_usergroup_parent_for_inherit_flag($group, 'preferences')]
        ?? 
$record['system_enabled'];
}

This article was last updated 4th December 2026 17:35 Europe/London time based on the source file dated 4th December 2026 14:10 Europe/London time.