PHP code example of amici / craft-super-content-access

1. Go to this page and download the library: Download amici/craft-super-content-access library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amici / craft-super-content-access example snippets




use craft\helpers\App;

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

    // Enable only in production (uses Craft’s existing env helpers)
    '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; not categories/products)
    'authorAlwaysAccess' => true,
];

// Dedicated flag in .env — e.g. SCA_AUTHORIZATION_ENABLED=true
'authorizationEnabled' => App::env('SCA_AUTHORIZATION_ENABLED') === 'true',

// Always on
'authorizationEnabled' => true,

// Always off (useful on local / staging)
'authorizationEnabled' => false,