Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 720c00f

Browse files
committed
disable inherit permissions in role permissions multiselect
1 parent 6c0156b commit 720c00f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG
22
=====================
33

4+
v1.0.1
5+
---------------------
6+
* Disable inherit permissions in role permissions selector.
7+
48
v1.0
59
---------------------
610
* Rbac console command to init, assign, scan roles

src/views/roles/_permission-options.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22
/* @var $this \yii\web\View */
33
/* @var $treeItems array */
4+
/* @var $disabled bool */
45

56
use yii\helpers\Html;
67

78
?>
89
<?php foreach ($treeItems as $item) : ?>
910
<option value="<?= Html::encode($item['name']) ?>" data-weight="<?= $item['order']; ?>"
11+
<?= !empty($disabled)? 'disabled="disabled"' : '' ?>
1012
style="padding-left: <?= $item['depth'] * 20; ?>px;" selected="selected">
1113
<?= Html::encode($item['name']) ?>
1214
</option>

src/views/roles/_permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<?php if (!empty($inheritTree)) : ?>
2121
<optgroup label="Inherit Permissions" data-weight="<?= end($inheritTree)['order']; ?>">
22-
<?= $this->render('_permission-options', ['treeItems' => $inheritTree]); ?>
22+
<?= $this->render('_permission-options', ['treeItems' => $inheritTree, 'disabled' => true]); ?>
2323
</optgroup>
2424
<?php endif; ?>
2525
</select>

0 commit comments

Comments
 (0)