laravel-google-drive-demo icon indicating copy to clipboard operation
laravel-google-drive-demo copied to clipboard

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

Open pisarevaa opened this issue 5 years ago • 3 comments

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.)

pisarevaa avatar Aug 16 '19 12:08 pisarevaa

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

ivanvermeyen avatar Aug 20 '19 11:08 ivanvermeyen

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

pat22292 avatar May 29 '20 13:05 pat22292

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!

pat22292 avatar May 30 '20 13:05 pat22292