diff --git a/app/Http/Controllers/GroupsController.php b/app/Http/Controllers/GroupsController.php index 577030390b..0c9823ca62 100755 --- a/app/Http/Controllers/GroupsController.php +++ b/app/Http/Controllers/GroupsController.php @@ -88,7 +88,10 @@ class GroupsController extends Controller $groupPermissions = []; } $selected_array = Helper::selectedPermissionsArray($permissions, $groupPermissions); - return view('groups.edit', compact('group', 'permissions', 'selected_array', 'groupPermissions')); + $associated_users = $group->users()->get(); + + //dd($associated_users->toArray()); + return view('groups.edit', compact('group', 'permissions', 'selected_array', 'groupPermissions'))->with('associated_users', $associated_users); } /** @@ -105,8 +108,11 @@ class GroupsController extends Controller $group->permissions = json_encode($request->input('permission')); $group->notes = $request->input('notes'); + \Log::error(print_r($request->input('associated_users'), true)); + if (! config('app.lock_passwords')) { if ($group->save()) { + $group->users()->sync($request->input('associated_users')); return redirect()->route('groups.index')->with('success', trans('admin/groups/message.success.update')); } diff --git a/config/permissions.php b/config/permissions.php index eaf7b3f785..ae90c566de 100644 --- a/config/permissions.php +++ b/config/permissions.php @@ -9,11 +9,11 @@ return [ - 'Global' => [ + 'Superuser' => [ [ 'permission' => 'superuser', 'label' => 'Super User', - 'note' => 'Determines whether the user has full access to all aspects of the admin. This setting overrides any more specific permissions throughout the system. ', + 'note' => 'Determines whether the user has full access to all aspects of the admin. This setting overrides ALL more specific and restrictive permissions throughout the system. ', 'display' => true, ], ], @@ -22,7 +22,7 @@ return [ [ 'permission' => 'admin', 'label' => '', - 'note' => 'Determines whether the user has access to most aspects of the admin. ', + 'note' => 'Determines whether the user has access to most aspects of the system EXCEPT the Admin Settings. These users will be able to manage users, locations, categories, etc, but ARE constrained by Full Multiple Company Support if it is enabled.', 'display' => true, ], ], diff --git a/resources/views/groups/edit.blade.php b/resources/views/groups/edit.blade.php index 4c387f73ef..77ca25db21 100755 --- a/resources/views/groups/edit.blade.php +++ b/resources/views/groups/edit.blade.php @@ -7,63 +7,25 @@ ]) @section('content') - @parent @stop @section('inputFields') +
| {{ trans('admin/groups/titles.permission')}} | -{{ trans('admin/groups/titles.grant')}} | -{{ trans('admin/groups/titles.deny')}} | -
|---|---|---|
- @unless (empty($localPermission['label']))
- {{ $area . ': ' . $localPermission['label'] }}- @else -{{ $area }}- @endunless - |
- - - - | -- - - | -
- {{ $area }}+
+ @foreach ($permissions as $area => $area_permission)
+
+
+ |
-
-
+
+
+
+
+ |
-
-
+
+
+ {{ trans('admin/groups/titles.allow')}}
+ {{ $area }}
+
+
+
+
+
+
+
+ |
-
| - {{ $this_permission['label'] }} - | -- + + | -- - - | - -