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 @@