Attach user to cache to prevent showing servers they can't access.
This commit is contained in:
parent
911434d033
commit
f91e4c511e
3 changed files with 8 additions and 3 deletions
|
@ -96,7 +96,7 @@ class Server extends Model
|
|||
public static function byUuid($uuid)
|
||||
{
|
||||
// Results are cached because we call this functions a few times on page load.
|
||||
$result = Cache::remember('Server.byUuid.' . $uuid, 60, function () use ($uuid) {
|
||||
$result = Cache::remember('Server.byUuid.' . $uuid . Auth::user()->uuid, 60, function () use ($uuid) {
|
||||
$query = self::with('service', 'node')->where(function ($q) use ($uuid) {
|
||||
$q->where('uuidShort', $uuid)->orWhere('uuid', $uuid);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue