mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Базовая реализация API для блокировки аккаунта
This commit is contained in:
30
api/modules/internal/controllers/AccountsController.php
Normal file
30
api/modules/internal/controllers/AccountsController.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace api\modules\internal\controllers;
|
||||
|
||||
use api\components\ApiUser\AccessControl;
|
||||
use api\controllers\Controller;
|
||||
use common\models\OauthScope as S;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
class AccountsController extends Controller {
|
||||
|
||||
public function behaviors() {
|
||||
return ArrayHelper::merge(parent::behaviors(), [
|
||||
'access' => [
|
||||
'class' => AccessControl::class,
|
||||
'rules' => [
|
||||
[
|
||||
'actions' => ['block'],
|
||||
'allow' => true,
|
||||
'roles' => [S::ACCOUNT_BLOCK],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionBlock(int $accountId) {
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user