Config

Last updated: July 21st 2026

Create config/super-content-access.php in your Craft project root’s config/ folder. Any key present here overrides the matching Control Panel setting; the settings screen shows a warning under overridden fields.

<?php

use craft\helpers\App;

return [
    // Optional CP nav label
    // 'pluginName' => 'Content Access',

    // Tie the master switch to Craft’s environment (or any .env value)
    'authorizationEnabled' => App::env('CRAFT_ENVIRONMENT') === 'production',

    // Craft admins see all protected content on the front end
    'adminAlwaysAccess' => true,

    // Entry authors always see their own entries (entries only)
    'authorAlwaysAccess' => true,
];

Env-driven examples

Use Craft’s App::env() (or App::parseBooleanEnv()) so local, staging, and production can differ without changing CP settings:

<?php

use craft\helpers\App;

return [
    // Only enforce access rules in production
    'authorizationEnabled' => App::env('CRAFT_ENVIRONMENT') === 'production',
    'adminAlwaysAccess' => true,
    'authorAlwaysAccess' => true,
];
<?php

use craft\helpers\App;

return [
    // Dedicated .env flags
    'authorizationEnabled' => App::parseBooleanEnv('$SCA_AUTHORIZATION_ENABLED') ?? true,
    'adminAlwaysAccess' => App::parseBooleanEnv('$SCA_ADMIN_ALWAYS_ACCESS') ?? true,
    'authorAlwaysAccess' => App::parseBooleanEnv('$SCA_AUTHOR_ALWAYS_ACCESS') ?? true,
];
<?php

return [
    'pluginName' => 'Content Access',
    'authorizationEnabled' => true,
    'adminAlwaysAccess' => true,
    'authorAlwaysAccess' => true,
];

When allowAdminChanges is false, prefer the config file (and env) for changes — the Settings screen stays visible but read-only.

KeyTypeDefaultDescription
pluginNamestringSuper Content AccessLabel shown in the Control Panel nav
authorizationEnabledbooltrueMaster switch for front-end query filtering
adminAlwaysAccessbooltrueCraft admins always see protected content on the front end
authorAlwaysAccessbooltrueEntry authors always see their own entries (not categories or products)