Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 82387

File document download and access-rules

$
0
0

Good morning,

I have an issue with downloading FileDocuments and Access Rights. I’m working on an application that serves external users that require access to personal Documents (which is a specialization of System.FileDocument). Company restrictions prohibit us to link the personal Documents to the Administration.Account object. Hence, when the user logs into the application, we create a non-persistent copy of the FileDocuments. When the user downloads a document, a microflow retrieves the persistent FileDocument based on a unique ID and downloads it for the user.

 

Now the issue: I can’t set Access Rights on the persistent Document, as there is no way to restrict it to '[%CurrentUser%]'. Giving Read rights to the table would allow potential access to the entire database table. I am thinking about creating an additional persistent FileDocument object (e.g. UserDownload, specialization of FileDocument) where the user gets full Read rights to the database table. When downloading a Document, I create a temporary UserDownload object, download it and then Rollback. This way, the table is only used to generate a FileDocument in cache for the user to download.

 

I don’t feel this is the best solution to my problem, hence the question: is there anyone who can share a best practice on this? Anyone who has dealt with a similar situation before and used a different solution as the one described above?

 

It would be highly appreciated!

Kind regards,

Rochus


Viewing all articles
Browse latest Browse all 82387

Trending Articles