yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.23k stars 6.91k forks source link

RBAC store into DB wrong type #11009

Closed tuannda closed 8 years ago

tuannda commented 8 years ago

I config components in config.php with

'authManager' => [
    'class' => 'yii\rbac\DbManager',
    'defaultRoles' => ['member'],
],

But when

$auth = Yii::$app->authManager; $adminRole = $auth->createPermission('admin'); $adminRole->description = "Admin Role"; $auth->add($adminRole);

I seen in DB type = 2. It's wrong..

mdmunir commented 8 years ago

whats wrong? permission type are 2. https://github.com/yiisoft/yii2/blob/master/framework/rbac/Item.php#L19