I’m working on a proof of concept for a personal project and am unsure how to go about handling ‘permissions’ on content that is uploaded into the application.
Problem: In this application users will be able to upload media/files onto the web server. Some content will be public, some content will require the user to be authenticated, and some content will only be shared with specific users (think social media/cloud storage).
I’m not sure how to go about implementing this in an efficient manner…
More information:
UI | Comms | Web Server (Linux OS)
------------------------------------------------
Xamarin/web | JSON | .NET (mono) + MySQL
- Assumption: You cannot send images via JSON, as such links to images/files are sent back and forth from the server.
- RESTful architecture
- Web Server will run on a Unix based OS (have been using Ubuntu so far)
Questions:
- How would I go about ensuring that unauthenticated users cant hotlink to images/files hosted on the server? (htaccess?)
- How would I ensure authenticated users cannot access images/files they do not have permission to? (i.e. via hotlinking)
Sorry if this is a silly question, i have very little experience with web based applications.