restrict uploaded files to user who owns the file

More
13 years 1 week ago #25826 by gcprnet
I have FC 1.5.6 RC5 (r1338) and Flexiaccess v. 1.0.5 and using Flexicontent I created a little project database where registered users can post their projects. Users are able to upload a PDF with contains a detailed description of their project. It's working pretty well but when users upload their files they can see (and chose from) all files that were uploaded by anyone. How can I manage it that users can only see (and select from) the files they uploaded? Any help is appreciated.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #25833 by ggppdk
mmm, i thinks, there is no simple (and global) way to do this without hacking the core.

Currently you will have to
-- 1. create one FLEXIaccess individual groups per user
-- 2. edit EVERY file and assign view level only to the owning user, which is very cumbersome to do.


The simplest way to do is to edit file.php and check that file owner is the current user (just 2 lines of code),

NOTE (if you are a developer) , in order to avoid problem with upgrading, you could duplicate file field and change it, just note that the usage column of file manager will not list assignment to the new field, which is not so much of a problem.

Maybe this would be useful to add this to the file field (since it is quite easy), just thinking if it is useful enough.

You mean that the you have a content Type of "student assignment"? Does it not have to be the whole item visible only to the user?

How exactly have you designed this? The items remain unpublished?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.372 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save