mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-28 23:19:42 -08:00
Merge branch 'develop'
This commit is contained in:
commit
74aa562a3b
|
@ -160,7 +160,6 @@ class ConsumablesController extends Controller
|
|||
*/
|
||||
public function getDataView($consumableId)
|
||||
{
|
||||
//$consumable = Consumable::find($consumableID);
|
||||
$consumable = Consumable::with(array('consumableAssignments'=>
|
||||
function ($query) {
|
||||
$query->orderBy('created_at', 'DESC');
|
||||
|
@ -171,12 +170,10 @@ class ConsumablesController extends Controller
|
|||
},
|
||||
))->find($consumableId);
|
||||
|
||||
// $consumable->load('consumableAssignments.admin','consumableAssignments.user');
|
||||
|
||||
if (!Company::isCurrentUserHasAccess($consumable)) {
|
||||
return ['total' => 0, 'rows' => []];
|
||||
}
|
||||
$this->authorize('view', Component::class);
|
||||
$this->authorize('view', Consumable::class);
|
||||
$rows = array();
|
||||
|
||||
foreach ($consumable->consumableAssignments as $consumable_assignment) {
|
||||
|
|
|
@ -284,9 +284,10 @@ class ViewAssetsController extends Controller
|
|||
public function getAcceptAsset($logID = null)
|
||||
{
|
||||
|
||||
if (!$findlog = Actionlog::where('id', $logID)->first()) {
|
||||
echo 'no record';
|
||||
//return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
$findlog = Actionlog::where('id', $logID)->first();
|
||||
|
||||
if (!$findlog) {
|
||||
return redirect()->to('account/view-assets')->with('error', 'No matching record.');
|
||||
}
|
||||
|
||||
if ($findlog->accepted_id!='') {
|
||||
|
|
|
@ -26,7 +26,6 @@ abstract class SnipePermissionsPolicy
|
|||
|
||||
public function index(User $user)
|
||||
{
|
||||
// dd('here');
|
||||
return $user->hasAccess($this->columnName().'.view');
|
||||
}
|
||||
/**
|
||||
|
@ -37,7 +36,6 @@ abstract class SnipePermissionsPolicy
|
|||
*/
|
||||
public function view(User $user, $item = null)
|
||||
{
|
||||
//
|
||||
return $user->hasAccess($this->columnName().'.view');
|
||||
}
|
||||
|
||||
|
@ -49,7 +47,6 @@ abstract class SnipePermissionsPolicy
|
|||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
//
|
||||
return $user->hasAccess($this->columnName().'.create');
|
||||
}
|
||||
|
||||
|
@ -61,7 +58,6 @@ abstract class SnipePermissionsPolicy
|
|||
*/
|
||||
public function update(User $user, $item = null)
|
||||
{
|
||||
//
|
||||
return $user->hasAccess($this->columnName().'.edit');
|
||||
}
|
||||
|
||||
|
@ -73,7 +69,6 @@ abstract class SnipePermissionsPolicy
|
|||
*/
|
||||
public function delete(User $user, $item = null)
|
||||
{
|
||||
//
|
||||
return $user->hasAccess($this->columnName().'.delete');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue