1. Go to this page and download the library: Download funson86/yii2-auth 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/ */
INSERT INTO `auth_operation` VALUES ('115', '0', 'Service');
INSERT INTO `auth_operation` VALUES ('11501', '115', 'viewService');
class ServiceController extends Controller
{
public function actionView($id)
{
if (!Yii::$app->user->can('viewService')) throw new ForbiddenHttpException(Yii::t('app', 'No Auth'));
// you business code
}
}
return [
'viewService' => 'View Service',
];
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.