update phân quyền chi tiết

This commit is contained in:
2020-11-02 14:35:22 +07:00
parent c4bb81e55c
commit e4a665dd2e
29 changed files with 1188 additions and 343 deletions

66
models/AuthItemChild.php Normal file
View File

@@ -0,0 +1,66 @@
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "auth_item_child".
*
* @property string $parent
* @property string $child
*
* @property AuthItem $parent0
* @property AuthItem $child0
*/
class AuthItemChild extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'auth_item_child';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['parent', 'child'], 'required'],
[['parent', 'child'], 'string', 'max' => 64],
[['parent', 'child'], 'unique', 'targetAttribute' => ['parent', 'child']],
[['parent'], 'exist', 'skipOnError' => true, 'targetClass' => AuthItem::className(), 'targetAttribute' => ['parent' => 'name']],
[['child'], 'exist', 'skipOnError' => true, 'targetClass' => AuthItem::className(), 'targetAttribute' => ['child' => 'name']],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'parent' => 'Parent',
'child' => 'Child',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getParent0()
{
return $this->hasOne(AuthItem::className(), ['name' => 'parent']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getChild0()
{
return $this->hasOne(AuthItem::className(), ['name' => 'child']);
}
}