Hi, im having problems with the file storage permission, im kinda new to this so feel free to correct me, im trying to set the permission of a specific file to just a specific user to read it, the problem is seems like no matter what configurations I do, it all depends If I disable the read of RestUser, but when I disable the rest user everyone cant access it and then when I enable the read of RestUser, everyone can read the file to a point that I can copy the directory of the file anywhere and can still be opened.
May I know if there’s something Im doing wrong? I just want a configuration where only a specific logged in user can access a file.
Thanks in advance.
Hello @Lerwin_Tan1
How do you configure?
Links can be usefull for file permisions: doc, video review
Regards
Hi, so i think we have an idea on the problem.
We needed to restrict the file to an authorized user.
and store the file link in a file reference column.
So we used this method:

which doesnt work because it required the header to have the proper user-token.
so we used the Rest component in order to be able to read the file which is a PDF:
which worked and produced output of:
the problem now is this is a PDF file and needs to be loaded as a PDF file, is there a way to convert it to pdf view? or is there another way of doing this? especially we need the files to be user specific permissions.
Thanks
Hello Lerwin Tan,
Could you please clarify if you were able to configure the permissions based on the information and links shared by my colleague in the previous post?
Also, I’m not entirely sure I understand your PDF-related task. From the screenshots, it looks like you’re using a print
block and outputting the PDF to the developer console (i.e., printing the byte stream as text). Could you please clarify what exactly you’re trying to achieve — do you want to download the PDF, display it in the browser, or something else?
Regards,
Alexander
Hi,
Yes, I already have an idea regarding configurations in the permissions.
the restuser read is what im having an issue, I want it denied as I dont want everyone to be able to access the file. And only can be seen by an authenticated user which I have no problem in doing the configurations in the permissions.
My problem is in the UI builder I cant figure out to load the pdf file in the browser since I can only read it when I use the Rest call component of the UI builder so that I can attach the user-token and grant access to the file, but the return is in byte format and I have no idea how to display it in PDF file format.
Maybe you can suggest a better idea on how to approach this?
Summary: I want to be able to display the PDF file in the browser, but only by a specific user.
Thank you for the clarification.
As far as I can tell, the file permissions are set correctly. To open the PDF in a browser, you could try using a Custom Code block with the following JavaScript code — it will open the PDF link in a new browser window:
fetch(url, {
method: "GET",
headers: {
"user-token": userToken
}
})
.then(response => response.blob())
.then(blob => {
const blobUrl = URL.createObjectURL(blob);
window.open(blobUrl);
})
.catch(console.error);
Alternatively, you might consider using a custom PDF viewer component.
Regards,
Alexander
Hi,
Thanks so much for the help, It Works!
1 Like