Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Controlling access to MultiFiles field contents
sbrickey
#1 Posted : Wednesday, December 21, 2011 4:21:14 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 12/16/2011(UTC)
Posts: 35
Location: Ohio, USA
so I have a content type with a MultiFiles field (yay!)... I want to require authentication to access these files (perhaps the user is a member of a specific role)...

I can link to the files easily enough using the ContentHelper.SplitMultiFiles(..) which is nice... but I notice the links are to cms_data/contents/sitename/folders/folder/~contents/userkey/filename

My concern is that once discovered, the link provides no protection/validation.

Without being overly familiar with kooboo (so far about 2 weeks) or razor (about the same 2 weeks, plus a few videos i'd seen on channel9).... I envisioned the following:

the existing page includes a view of the content type, and a URL rule for userkey (similar to the SampleSite Articles detail page)
I would like some sort of virtual path following the userkey ("files" or something) and another URL rule for the filename...

this would result in the following URLs:
site.com/Articles/Article1 (the primary details page, including links to files)
site.com/Articles/Article1/files/file1.txt
site.com/Articles/Article1/files/file2.txt

then (based on my knowledge of webforms), a view could (after validating access) clear the response buffer, set mime type and such, write the file contents to the response buffer, flush, and close.

the two primary issues:
not sure how to design a page with such complex rules (Articles/{ArticleKey}/files/{filename}
not sure if doing the response stream manipulation will work in razor the way it did in webforms.

I am also not sure whether this would be the BEST approach.


I've also wondered whether page mappings would be the correct approach, but i'm pretty unfamiliar with MVC routing rules in general.


Any thoughts/recommendations are welcome :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.115 seconds.