mg-code/yii2-auth

RBAC auth functionality for Yii2 framework

Installs: 3 979

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2016-10-04 10:35 UTC

This package is auto-updated.

Last update: 2024-04-27 03:22:36 UTC


README

Once the extension is installed, simply modify your application configuration as follows:

return [
    'components' => [
        ....
        'authManager' => [
            'class' => 'yii\rbac\DbManager',
            'defaultRoles' => ['public', 'authenticated'],
        ]
    ],
    'as access' => [
        'class' => 'mgcode\auth\components\AccessControl',
        'app' => 'backend',
        'allowActions' => [
            'site/error'
        ],
        'disallowActions' => [
            'disabled/action',
        ]
    ],
];

See Yii RBAC for more detail.