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