This commit is contained in:
Kekskurse 2021-01-19 23:32:50 +01:00
parent ebc4629c91
commit fccc353aaa

View file

@ -14,6 +14,7 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use phpDocumentor\Reflection\Types\Integer;
@ -44,7 +45,12 @@ class PublicController extends BaseController
public function listGalleryImagesView($tenant, $gallery) {
$tenant = Tenant::query()->where("url", "=", $tenant)->firstOrFail();
$gallery = Gallery::getByTenantAndUrl($tenant->id, $gallery);
if($gallery->status == "online" || ($gallery->status == "preview" && Auth::user()->id == $tenant->owner)) {
$images = Image::query()->where("gallery", "=", $gallery->id)->whereNull("deleted_at")->get();
} else {
abort( 404);
}
return view("themes.gallery.gallery-detail.list", ["gallery" => $gallery, "tenant" => $tenant, "images" => $images]);
}