Yii Framework Forum: Looking for file manager with restrictions - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Looking for file manager with restrictions Rate Topic: -----

#1 User is offline   Lu01 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-March 17

Posted 06 September 2017 - 06:59 PM

Hello,

I am using Yii2 and I find it great to develop web-apps.

I would need a file manager to upload/view/link documents, but I need that documents belongs to categories with rights management:

I mean I have users editing the education category (with multiple articles) and I do not want them to be able to manage documents belonging to sport category.
Is there some file manager extensions able to do that?
0

#2 User is offline   Uldis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 12-December 12
  • Location:Latvia

Posted 07 September 2017 - 07:59 AM

In https://github.com/d3yii2/d3files is realised access control by controller using standard RBAC. Realy standard solution.
1

#3 User is offline   Lu01 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-March 17

Posted 07 September 2017 - 10:53 AM

Thank you for the answer, I am trying to install it, but I don't understand in which file I have to put these lines :

Quote

'yii.migrations' => [
'@vendor/d3yii2/d3files/migrations',
],


I have the Yii2 advanced template and want to use the extension in the backend.
Can you help me please ?
0

#4 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 07 September 2017 - 12:38 PM

Just ignore that and run the migrations manually.
"Less noise - more signal"
0

#5 User is offline   Lu01 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-March 17

Posted 07 September 2017 - 01:43 PM

View Postjacmoe, on 07 September 2017 - 12:38 PM, said:

Just ignore that and run the migrations manually.

OK, but how I do the migration manually?
0

#6 User is offline   Uldis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 12-December 12
  • Location:Latvia

Posted 07 September 2017 - 01:59 PM

I use https://github.com/d...migrate-command for setting all module migration.

OR

yii migrate --migrationPath=@app/modules/forum/migrations
0

#7 User is offline   Lu01 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-March 17

Posted 07 September 2017 - 03:06 PM

I have Yii 2.0.12

Here is my console/config/main.php :

return [
    'id' => 'app-console',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'console\controllers',
    'controllerMap' => [
        'fixture' => [
            'class' => 'yii\console\controllers\FixtureController',
            'namespace' => 'common\fixtures',
          ],
        'migrate' => [
            'class' => \yii\console\controllers\MigrateController::class,
            'migrationNamespaces' => [
                'Da\User\Migration',
            ],

        ],
    ],
    'modules' => [
        'user' =>  Da\User\Module::class,
    ],
    'components' => [
        'log' => [
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
    ],
    'params' => $params,

];


Where do I have to add the configuration to do the migration ?
0

#8 User is offline   Uldis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 12-December 12
  • Location:Latvia

Posted 07 September 2017 - 10:29 PM


$basePath = dirname(dirname(dirname(dirname(__DIR__))));

$params = require(__DIR__ . '/params.php');
$aliases = require(__DIR__ . '/aliases.php');
$db = require(__DIR__ . '/db.php');


return  [
    'id' => 'basic-console',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log', 'coalmar\delivery\Bootstrap'],
    'controllerNamespace' => 'app\commands',
    'controllerMap' => [
        'migrate' => 'dmstr\console\controllers\MigrateController',
    ],
    'modules' => [
          ......
    ],    
    'components' =>
    [
        'i18n' => [
            'translations' => require 'translations.php',
        ],        
        'cache' => [
            'class' => 'yii\caching\FileCache',
            'fileMode' => 0666,
        ],
        'log' => [
            'traceLevel' => getenv('YII_TRACE_LEVEL'),
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
//                    'prefix' => function () {
//                        return '[console]';
//                    },
                    'levels' => YII_DEBUG ? ['error', 'warning', 'info'] : ['error', 'warning'],
                    'logFile' => $basePath . '/runtime/logs/console.log',
                    'dirMode' => 0777,
                    'exportInterval' => 1, // <-- and here
                ],
                [
                    'class' => 'yii\log\EmailTarget',
                    'levels' => ['error', 'warning'],
                    'message' => [
                        'from' => ['aaaa@aaaa.lv'],
                        'to' => ['fffff@gmail.com'],
                        'subject' => 'Errors COALMAR',
                    ],
                ],
            ],
        ],
        'db' => $db,
        'authManager' => [
            'class' => 'yii2d3\d3persons\components\D3AuthManager',
        ],
    ],
    'aliases' => array_merge($aliases, [
        '@vendor' => rtrim($basePath, '\\/') . '/vendor',
    ]),
    'params' => array_merge($params,[
        'yii.migrations' => [
                '@dektrium/yii2-user/migrations',
                '@yii/rbac/migrations',
                '@vendor/d3yii2/d3files/migrations',
                '@vendor/cornernote/yii2-dashboard/src/migrations',
            ]
    ]),
];


0

#9 User is offline   Lu01 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-March 17

Posted 08 September 2017 - 04:24 AM

I have added:
    'params' => array_merge($params,[
        'yii.migrations' => [
            '@vendor/d3yii2/d3files/migrations',
        ],
    ]),

But when I launch yii migrate it tells me:
Yii Migration Tool (based on Yii v2.0.12)

No new migrations found. Your system is up-to-date.

0

#10 User is offline   Uldis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 12-December 12
  • Location:Latvia

Posted 08 September 2017 - 04:53 AM

Please install https://github.com/d...migrate-command
and changhe in console config

    'controllerMap' => [
        'migrate' => 'dmstr\console\controllers\MigrateController',
    ],

0

#11 User is offline   Lu01 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-March 17

Posted 08 September 2017 - 08:07 AM

Ok, but it's written as deprecated in the doc

Quote

DEPRECATION NOTICE - since Yii 2.0.12 this extension is obsolete, its functionality is now supported by the framework core. For details see also issue.
and that it is supported in framework core so I have added in the 'controllerMap' => [
        // Migrations for the specific extension
        'migrate-d3files' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationPath' => '@vendor/d3yii2/d3files/migrations',

        ],

and then run a yii migrate-d3files
The migration is ok, I'll try the module now ;-)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users