/
PermissionController.php
85 lines (58 loc) · 2.19 KB
/
PermissionController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* This file is part of CMSGears Framework. Please view License file distributed
* with the source code for license details.
*
* @link https://www.cmsgears.org/
* @copyright Copyright (c) 2015 VulpineCode Technologies Pvt. Ltd.
*/
namespace cmsgears\core\admin\controllers;
// Yii Imports
use Yii;
use yii\helpers\Url;
/**
* PermissionController provides actions specific to permission model.
*
* @since 1.0.0
*/
class PermissionController extends \cmsgears\core\admin\controllers\base\PermissionController {
// Variables ---------------------------------------------------
// Globals ----------------
// Public -----------------
// Protected --------------
// Private ----------------
// Constructor and Initialisation ------------------------------
public function init() {
parent::init();
// Config
$this->apixBase = 'core/permission';
// Sidebar
$this->sidebar = [ 'parent' => 'sidebar-rbac', 'child' => 'perm' ];
// Return Url
$this->returnUrl = Url::previous( 'permissions' );
$this->returnUrl = isset( $this->returnUrl ) ? $this->returnUrl : Url::toRoute( [ '/core/permission/all' ], true );
// Breadcrumbs
$this->breadcrumbs = [
'base' => [
[ 'label' => 'Home', 'url' => Url::toRoute( '/dashboard' ) ]
],
'all' => [ [ 'label' => 'Permissions' ] ],
'groups' => [ [ 'label' => 'Permissions', 'url' => $this->returnUrl ], [ 'label' => 'Groups' ] ],
'create' => [ [ 'label' => 'Permissions', 'url' => $this->returnUrl ], [ 'label' => 'Add' ] ],
'update' => [ [ 'label' => 'Permissions', 'url' => $this->returnUrl ], [ 'label' => 'Update' ] ],
'delete' => [ [ 'label' => 'Permissions', 'url' => $this->returnUrl ], [ 'label' => 'Delete' ] ]
];
}
// Instance methods --------------------------------------------
// Yii interfaces ------------------------
// Yii parent classes --------------------
// yii\base\Component -----
// yii\base\Controller ----
// CMG interfaces ------------------------
// CMG parent classes --------------------
// PermissionController ------------------
public function actionAll( $config = [] ) {
Url::remember( Yii::$app->request->getUrl(), 'permissions' );
return parent::actionAll( $config );
}
}