Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Sep 8, 2016
1 parent d455559 commit d14b5da
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
==============

1.0.2
-----------------
* Fixed bugs

1.0.1
-----------------
* To read app configs
Expand Down
5 changes: 4 additions & 1 deletion controllers/AdminPermissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ public function actionView()
if (in_array($name, $children)) {
continue;
}
$avaliable[$name[0] === '/' ? 'Routes' : 'Permission'][$name] = $name . '' . $role->description;;
if (isset($name[0]))
{
$avaliable[$name[0] === '/' ? 'Routes' : 'Permission'][$name] = $name . '' . $role->description;
}
}
foreach ($authManager->getChildren($id) as $name => $child) {
$assigned[$name[0] === '/' ? 'Routes' : 'Permission'][$name] = $name . '' . $child->description;;
Expand Down
6 changes: 5 additions & 1 deletion controllers/AdminRoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ public function actionView()
if (in_array($name, $children)) {
continue;
}
$avaliable[$name[0] === '/' ? 'Routes' : 'Permission'][$name] = $name . '' . $role->description;

if (isset($name[0]))
{
$avaliable[$name[0] === '/' ? 'Routes' : 'Permission'][$name] = $name . '' . $role->description;
}
}
foreach ($authManager->getChildren($id) as $name => $child) {
if ($child->type == Item::TYPE_ROLE) {
Expand Down
2 changes: 2 additions & 0 deletions models/AuthItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace skeeks\cms\rbac\models;
use Yii;
use yii\helpers\ArrayHelper;
use yii\rbac\Item;
use yii\helpers\Json;
/**
Expand Down Expand Up @@ -58,6 +59,7 @@ public function rules()
[['ruleName'], 'in',
'range' => array_keys(Yii::$app->authManager->getRules()),
'message' => 'Rule not exists'],
//[['name'], 'unique', 'targetAttribute' => array_keys(ArrayHelper::map(\Yii::$app->authManager->getRoles(), 'name', 'name')) ],
[['name', 'type'], 'required'],
[['type'], 'integer'],
[['description', 'data', 'ruleName'], 'default'],
Expand Down
2 changes: 1 addition & 1 deletion views/admin-permission/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
])
?>

<?= $form->field($model, 'data')->textarea(['rows' => 6, 'readonly' => 'readonly'])->label(\Yii::t('app','Data')) ?>
<?/*= $form->field($model, 'data')->textarea(['rows' => 6, 'readonly' => 'readonly'])->label(\Yii::t('app','Data')) */?>

<?= $form->buttonsCreateOrUpdate($model); ?>

Expand Down
2 changes: 1 addition & 1 deletion views/admin-role/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
])
*/?>

<?= $form->field($model, 'data')->textarea(['rows' => 6, 'readonly' => 'readonly'])->label(\Yii::t('app','Data')) ?>
<?/*= $form->field($model, 'data')->textarea(['rows' => 6, 'readonly' => 'readonly'])->label(\Yii::t('app','Data')) */?>

<?= $form->buttonsCreateOrUpdate($model); ?>

Expand Down

0 comments on commit d14b5da

Please sign in to comment.