Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict DownloadLinks to a specific user #9

wants to merge 3 commits into from


Copy link

Yiddishe-Kop commented Aug 30, 2020

This PR adds functionality to create a DownloadLink for a specific user.


When creating a DownloadLink you can chain a ->for($userId) to assign the link to a specific user:

$link = DownloadLinkGenerator::disk('local')->filePath('files/lesson 1.mp4')->for(auth()->id())->generate();

Now only this user will be able to access the download.

Thanks for the package! 馃槂

Copy link

Yiddishe-Kop commented Aug 30, 2020

Nice work! 馃挕

Maybe we can let the ->for($userId) method also accept a User instance (or a collection of Users).
By default it can assume the default Laravel App\User model, but also expose a config option to specify the User model to use.

Copy link

armancodes commented Aug 30, 2020

Hi, Thanks for your great idea.

I'm SO SORRY to tell you that I cannot merge this PR. There is a law in my country that we MUST NOT have any relationship with people from Israel or the Israel government.

I hope you understand this, and again thanks for your time.

@armancodes armancodes closed this Aug 30, 2020
Copy link

Yiddishe-Kop commented Aug 30, 2020

That's very sad, @armancodes.

I hope one day your country removes this restriction, just like my country has never put such restrictions.

However I'm sure that your governments restrictions don't represent your views 馃し鈥嶁檪锔 .

Good luck anyway! 馃槂

Copy link

motcke commented Sep 2, 2020

If it's ok with the developer, can someone, not from Israel fork to his own account and ask for MR from his account? It's a shame such good feature will be missed for these reasons.

Copy link

oferze commented Sep 3, 2020

Actually I hope it won't be forked to bypass this political restriction. Let the problem be until it escalates to GitHub's (Microsoft) management to find a proper way to deal with this.

I would've said "let it go up to the Iranian government" but I know this won't do anything.

Copy link

claui commented Sep 3, 2020

Chances are that a fork would still put Arman in danger.
Iranian jurisdiction could argue that the software still originates from Israel 馃槥 (Israeli source).

Copy link

behdad commented Sep 3, 2020

Just merge it.

Repository owner locked and limited conversation to collaborators Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can鈥檛 perform that action at this time.