isAdmin()) { return true; } else { if ($folder->user_id == $user->id || $user->mailboxesSettings()->pluck('mailbox_id')->contains($folder->mailbox_id)) { return true; } else { return false; } } } }