Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Versioned Files - old versions are web accessible


Go to End


3 Posts   968 Views

Avatar
Mike Waters

Community Member, 6 Posts

2 March 2012 at 3:52pm

Hi All

I'm new to Silverstripe and have a question about the Versioned Files module.

Old versions of files are stored under the assets directory, eg

if a file is here...

.../assets/documents/File.pdf

its versions are here....
.../assets/documents/_versions/123/File.1.pdf

I noticed that these file versions are accessible to unauthenticated site visitors.

Is there any way of hiding these from site visitors, but keeping them visible for users logged into the admin interface?

I have searched the web and forums for this with no luck so far

thanks in advance!

-Mike

Avatar
Juanitou

Community Member, 323 Posts

2 March 2012 at 9:45pm

Hi Mike.

I’ve used the secure files module for this kind of issue.

Hope it helps,
Juan

Avatar
Mike Waters

Community Member, 6 Posts

8 March 2012 at 7:12pm

Edited: 08/03/2012 7:13pm

Thanks for that Juanitou

I gave Secure Files module a whirl and it doesn't seem to play nice with Versioned Files :( (or vice versa of course)

The secure files module adds access controls to Folders that are visible in the Files and Images section tree.
Unfortunately the files I need to secure are in subfolders named _versions but these are not visible in the tree so I can't apply access controls directly.

Also if I make a visible Folder secure via the Secure Files module, any version files (eg asssets/documents/_versions/123/File.1.pdf) give me 403 both in the browser and CMS.

If anyone has any suggestions about where to go from here it would be good... even if it means getting into the code.

Another option I considered was to make some manual updates to .htaccess, if anyone can point me in the direction of the "SilverStripe Way" for that kind of thing

thanks again

-Mike