public function index()
    {
        if (!userHasPermission('admin:cdn:manager:object:browse')) {
            unauthorised();
        }

        $oInput                    = Factory::service('Input');
        $this->data['sBucketSlug'] = $oInput->get('bucket');

        $oAsset = Factory::service('Asset');
        $oAsset->library('KNOCKOUT');
        //  @todo (Pablo - 2018-12-01) - Update/Remove/Use minified once JS is refactored to be a module
        $oAsset->load('admin.mediamanager.js', 'nails/module-cdn');

        $sBucketSlug      = $oInput->get('bucket');
        $sCallbackHandler = $oInput->get('CKEditor') ? 'ckeditor' : 'picker';

        if ($sCallbackHandler === 'ckeditor') {
            $aCallback = [$oInput->get('CKEditorFuncNum')];
        } else {
            $aCallback = array_filter((array) $oInput->get('callback'));
        }

        $oAsset->inline(
            'ko.applyBindings(
                new MediaManager(
                    "' . $sBucketSlug . '",
                    "' . $sCallbackHandler . '",
                    ' . json_encode($aCallback) . ',
                    ' . json_encode((bool) $oInput->get('isModal')) . '
                )
            );',
            'JS'
        );

        Helper::loadView('index');
    }