ivanvermeyen / laravel-google-drive-demo

Laravel & Google Drive Storage - Demo project with Laravel 5.4
405 stars 155 forks source link

How to grant permissions on a folder to a user (e-mail) #58

Open pisarevaa opened 5 years ago

pisarevaa commented 5 years ago

Hi, how to grant permissions on a folder to a user (e-mail)? I only can grant public or private permissions but I need grant specific rules (e-mail, type etc.)

ivanvermeyen commented 5 years ago

Hey, that's a pretty advanced use case. I currently don't have an answer to this... I would need to dig deeper and learn this myself :) Perhaps the creator of the underlying driver package can help you more with this issue?

https://github.com/nao-pon/flysystem-google-drive

pat22292 commented 4 years ago

Hi @pisarevaa , how can you change the permission to private? Ithanks

pat22292 commented 4 years ago

I just want to apologize for my question.

I overlooked these lines of codes.

$dir = '/'; $recursive = false; // Get subdirectories also? $contents = collect(Storage::cloud()->listContents($dir, $recursive)); $file = $contents ->where('type', '=', 'file') ->where('filename', '=', pathinfo($filename, PATHINFO_FILENAME)) ->where('extension', '=', pathinfo($filename, PATHINFO_EXTENSION)) ->first(); // there can be duplicate file names!

instead of using Storage::disk('google')->url($attachedFile->getClientOriginalName().''); which make the files public.

that brilliant idea of yours @ivanvermeyen solves my problem, thanks you!