From 7fd60515148dee7881f8b372bd9f66ce869d56bc Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 20 May 2016 12:23:31 -0700 Subject: [PATCH] Fixes #2062 - old permissions masks to new --- app/Http/Controllers/GroupsController.php | 12 ++++++------ resources/views/groups/edit.blade.php | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/GroupsController.php b/app/Http/Controllers/GroupsController.php index 89ddd89fc0..50951e6955 100755 --- a/app/Http/Controllers/GroupsController.php +++ b/app/Http/Controllers/GroupsController.php @@ -47,11 +47,11 @@ class GroupsController extends Controller $group = new Group; // Get all the available permissions $permissions = config('permissions'); - - $selectedPermissions = Input::old('permissions', array()); + $groupPermissions = array(); + $selectedPermissions = Input::old('permissions', $groupPermissions); // Show the page - return View::make('groups/edit', compact('permissions', 'selectedPermissions'))->with('group', $group); + return View::make('groups/edit', compact('permissions', 'selectedPermissions', 'groupPermissions'))->with('group', $group); } /** @@ -91,9 +91,9 @@ class GroupsController extends Controller { $group = Group::find($id); $permissions = config('permissions'); - $group->permissions = $group->decodePermissions(); - $selected_array = Helper::selectedPermissionsArray($permissions, $group->permissions); - return View::make('groups/edit', compact('group', 'permissions','selected_array')); + $groupPermissions = $group->decodePermissions(); + $selected_array = Helper::selectedPermissionsArray($permissions, $groupPermissions); + return View::make('groups/edit', compact('group', 'permissions','selected_array','groupPermissions')); } /** diff --git a/resources/views/groups/edit.blade.php b/resources/views/groups/edit.blade.php index 7fc9508b10..0704bf51be 100755 --- a/resources/views/groups/edit.blade.php +++ b/resources/views/groups/edit.blade.php @@ -67,11 +67,12 @@