mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
permissions query fixes (#12220)
This commit is contained in:
@ -195,7 +195,9 @@ class Permissions
|
|||||||
$user_id = $this->getUserId($user);
|
$user_id = $this->getUserId($user);
|
||||||
|
|
||||||
if (! isset($this->devicePermissions[$user_id])) {
|
if (! isset($this->devicePermissions[$user_id])) {
|
||||||
$this->devicePermissions[$user_id] = DB::table('devices_perms')->where('user_id', $user_id)
|
$this->devicePermissions[$user_id] = DB::table('devices_perms')
|
||||||
|
->select(['user_id', 'device_id'])
|
||||||
|
->where('user_id', $user_id)
|
||||||
->union($this->getDeviceGroupPermissionsQuery()->where('user_id', $user_id))
|
->union($this->getDeviceGroupPermissionsQuery()->where('user_id', $user_id))
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
@ -211,7 +213,9 @@ class Permissions
|
|||||||
public function getPortPermissions()
|
public function getPortPermissions()
|
||||||
{
|
{
|
||||||
if (is_null($this->portPermissions)) {
|
if (is_null($this->portPermissions)) {
|
||||||
$this->portPermissions = DB::table('ports_perms')->get();
|
$this->portPermissions = DB::table('ports_perms')
|
||||||
|
->select(['user_id', 'port_id'])
|
||||||
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->portPermissions;
|
return $this->portPermissions;
|
||||||
@ -225,7 +229,8 @@ class Permissions
|
|||||||
public function getBillPermissions()
|
public function getBillPermissions()
|
||||||
{
|
{
|
||||||
if (is_null($this->billPermissions)) {
|
if (is_null($this->billPermissions)) {
|
||||||
$this->billPermissions = DB::table('bill_perms')->get();
|
$this->billPermissions = DB::table('bill_perms')
|
||||||
|
->select(['user_id', 'bill_id'])->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->billPermissions;
|
return $this->billPermissions;
|
||||||
|
Reference in New Issue
Block a user