|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace app\controllers\admin; |
|
4
|
|
|
|
|
5
|
|
|
use app\traits\{LanguageTrait, AdminBeforeActionTrait, AccessTrait}; |
|
6
|
|
|
use Itstructure\RbacModule\controllers\ProfileController as BaseProfileController; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class ProfileController |
|
10
|
|
|
* ProfileController implements the CRUD actions for identityClass. |
|
11
|
|
|
* |
|
12
|
|
|
* @package app\controllers\admin |
|
13
|
|
|
* |
|
14
|
|
|
* @author Andrey Girnik <[email protected]> |
|
15
|
|
|
*/ |
|
16
|
|
|
class ProfileController extends BaseProfileController |
|
17
|
|
|
{ |
|
18
|
|
|
use LanguageTrait, AdminBeforeActionTrait, AccessTrait; |
|
|
|
|
|
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @return mixed|string |
|
22
|
|
|
*/ |
|
23
|
|
|
public function actionIndex() |
|
24
|
|
|
{ |
|
25
|
|
|
if (!$this->checkAccessToIndex()) { |
|
26
|
|
|
return $this->accessError(); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
return parent::actionIndex(); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @param int|string $id |
|
34
|
|
|
* |
|
35
|
|
|
* @return mixed |
|
36
|
|
|
*/ |
|
37
|
|
|
public function actionView($id) |
|
38
|
|
|
{ |
|
39
|
|
|
if (!$this->checkAccessToView()) { |
|
40
|
|
|
return $this->accessError(); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
return parent::actionView($id); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @param int|string $id |
|
48
|
|
|
* |
|
49
|
|
|
* @return string|\yii\web\Response |
|
50
|
|
|
*/ |
|
51
|
|
|
public function actionUpdate($id) |
|
52
|
|
|
{ |
|
53
|
|
|
if (!$this->checkAccessToUpdate()) { |
|
54
|
|
|
return $this->accessError(); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
return parent::actionUpdate($id); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @param int|string $id |
|
62
|
|
|
* |
|
63
|
|
|
* @return mixed|\yii\web\Response |
|
64
|
|
|
*/ |
|
65
|
|
|
public function actionDelete($id) |
|
66
|
|
|
{ |
|
67
|
|
|
if (!$this->checkAccessToDelete()) { |
|
68
|
|
|
return $this->accessError(); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
return parent::actionDelete($id); |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|