How do you restrict media ( docs, pdf's, media) to only front end members

paul krysiak asked on May 23, 2017 18:08

I wanted to know if is is possible to restrict media content to only specific roles on the front end.
I can do this in the admin with the permission and access settings, but if i have a direct link to the content then i can access it anonymously.
I found the kentico media documentation and set everything up as they outlined. Kentico 8 Media Documentation

Is there any way to do this without creating a handler that obfuscated the direct url?

Correct Answer

Development Support Avastonetech answered on May 23, 2017 19:51

Sadly you normally will need to use the non direct url in order to apply roles, as if you do a direct call to the file it will normally just load the file, and Kentico has no 'say' in the matter.

So first step would be yes, you will need to use the /getmedia or /getfile type of urls (usully passing it the GUID).

Once you use that then Peter has the correct next step, use Kentico's permissions to authorize accesses.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on May 23, 2017 19:42

If you go to Media Library[YourLibraryName]\Security, you can set 'see library content' to 'Authorized roles' and pick your roles below.

0 votesVote for this answer Mark as a Correct answer

paul krysiak answered on May 23, 2017 22:16

Thank you both!
I did set the Authorized roles on the media library. I can access them through the direct link without logging in.
I'll go back to the handler solution until we come up with a better way.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.