mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Fixes #2062 - old permissions masks to new
This commit is contained in:
parent
f6cdd90e41
commit
7fd6051514
|
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,11 +67,12 @@
|
|||
<div class="form-group" style="padding-left: 15px;">
|
||||
|
||||
<label class="radio-padding">
|
||||
{{ Form::radio('permission['.$permission_name.']', 1, $group->permissions[$permission_name], ['class' => 'minimal']) }}
|
||||
{{ Form::radio('permission['.$permission_name.']', 1,
|
||||
(array_key_exists($permission_name, $groupPermissions) && $groupPermissions[$permission_name]), ['class' => 'minimal']) }}
|
||||
Grant</label>
|
||||
|
||||
<label class="radio-padding">
|
||||
{{ Form::radio('permission['.$permission_name.']', 0, !$group->permissions[$permission_name], ['class' => 'minimal']) }}
|
||||
{{ Form::radio('permission['.$permission_name.']', 0, (!array_key_exists($permission_name, $groupPermissions) || !$groupPermissions[$permission_name]), ['class' => 'minimal']) }}
|
||||
Deny</label>
|
||||
</div>
|
||||
<hr>
|
||||
|
|
Loading…
Reference in a new issue