'delete' => ['post'], | 'delete' => ['post'], | ||||
], | ], | ||||
], | ], | ||||
'access' => [ | |||||
'class' => AccessControl::className(), | |||||
'rules' => [ | |||||
[ | |||||
'allow' => true, | |||||
'access' => [ | |||||
'class' => AccessControl::className(), | |||||
'rules' => [ | |||||
[ | |||||
'allow' => true, | |||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ; | |||||
} | |||||
], | |||||
], | |||||
'matchCallback' => function ($rule, $action) { | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN | |||||
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER; | |||||
} | |||||
], | |||||
], | |||||
], | ], | ||||
]; | ]; | ||||
} | } |
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | 'matchCallback' => function ($rule, $action) { | ||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ; | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN | |||||
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER; | |||||
} | } | ||||
] | ] | ||||
], | ], |
'actions' => ['logout', 'index'], | 'actions' => ['logout', 'index'], | ||||
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | |||||
return Yii::$app->user->identity->status == User::STATUS_ADMIN ; | |||||
'matchCallback' => function ($rule, $action) { | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN | |||||
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER; | |||||
} | } | ||||
], | ], | ||||
], | ], |
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | 'matchCallback' => function ($rule, $action) { | ||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ; | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN | |||||
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER; | |||||
} | } | ||||
] | ] | ||||
], | ], |
[ | [ | ||||
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
/*'matchCallback' => function ($rule, $action) { | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ; | |||||
}*/ | |||||
'matchCallback' => function ($rule, $action) { | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN | |||||
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER; | |||||
} | |||||
] | ] | ||||
], | ], | ||||
], | ], |
'allow' => true, | 'allow' => true, | ||||
'roles' => ['@'], | 'roles' => ['@'], | ||||
'matchCallback' => function ($rule, $action) { | 'matchCallback' => function ($rule, $action) { | ||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ; | |||||
return Yii::$app->user->identity->status == USER::STATUS_ADMIN | |||||
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER; | |||||
} | } | ||||
] | ] | ||||
], | ], |
{ | { | ||||
const STATUS_DELETED = 0; | const STATUS_DELETED = 0; | ||||
const STATUS_ACTIVE = 10; | const STATUS_ACTIVE = 10; | ||||
const STATUS_BOULANGER = 11; | |||||
const STATUS_ADMIN = 13; | const STATUS_ADMIN = 13; | ||||
/** | /** |