Forum Academy Marketplace Showcase Pricing Features

Problem with permissions to a file

Hi, I have files uploaded by users. They are uploaded to a private table called upload which has a file field called file. Users have a filed calls is_empoyee to mark that they have more permissions. In particular I want the employees to be able to see the files uploaded by other users. When I access a file (via PDF viewer plugin) as an employee I get
{"error_class":"Unauthorized","args":{"code":"1641444670335x440151950167047700"},"message":null,"translation":"Permission denied"}
but when I access the same file as the user who uploaded it I can see the file.
Please see the permissions I set:

What am I missing? why can the user marked as is_employee see the files?

p.s. the way the page is set up now is that when the user clicks a button it sets a state variable with the correct upload and then opens a popup with the PDF viewer plugin element, which shows the PDF in a full screen (because I haven’t manage to have it not in full screen yet).

Would be happy to read your suggestion of how to fix the permissions.

This topic was automatically closed after 70 days. New replies are no longer allowed.