This is a migrated thread and some comments may be shown as answers.

How to lock down ImageManager paths?

4 Answers 72 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tom Kaminski
Top achievements
Rank 1
Tom Kaminski asked on 08 Feb 2010, 07:57 PM
My web site serves multiple customers where the content is customized depending on the domain name used to access the site.  As such, I have a subfolder under the images folder for each customer.  I can dynamically set the ImageManager paths in code using "~/images/" & CustID, but when the customer uses the ImageManager they always have access to the "images" folder.  How can I lock them into their CustId folder under images?  Is there a better approach?

4 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 10 Feb 2010, 05:01 PM
Hi Tom,

By design, ImageManager does not provide access to the parent directory if it is not set as a path where  RadEditor should look for images.  Could you please provide a sample code which handles this manipulation so we can investigate it?


<%-- This will provide access to both folders (and all their sub-folders if any)  but not to /images --%>
<ImageManager ViewPaths="~/images/John,~/images/Peter" />
 
<%-- Same as above but since /Peter is a sub-folder user will have access to it even with out its declaration --%>
<ImageManager ViewPaths="~/images/,~/images/Peter" />

For your convenience I have attached a movie showing the difference of the two declarations.

Best wishes,
Dobromir
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Tom Kaminski
Top achievements
Rank 1
answered on 11 Feb 2010, 09:12 PM
Thanks for your response.  Attached is an image of what I get - essentially I do not want users to be able to get into the images or photos folders, just the "1" subfolders.

My code is as follows (in the Page_Load event):

Dim viewpath As String() = {"~/images/" & DeptIDLabel.Value, "~/photos/" & DeptIDLabel.Value}  
Editor1.ImageManager.ViewPaths = viewpath  
Editor1.ImageManager.UploadPaths = viewpath 
0
Dobromir
Telerik team
answered on 12 Feb 2010, 03:17 PM
Hi Tom,

The provided code looks OK. The only reason I can think of for this problem to occur is that DeptIDLabel.Value value is an empty string (""). If this is not the case, could you please open a support ticket and attach a sample runable project that reproduces the problem for further investigation?

Greetings,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Tom Kaminski
Top achievements
Rank 1
answered on 13 Feb 2010, 02:32 PM

Thanks Dobromir.

As you can see by that attached image, DeptIDLabel.Value is in fact returning a valid value, "1" in this case.

 

I will open a support ticket.

Tags
Editor
Asked by
Tom Kaminski
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Tom Kaminski
Top achievements
Rank 1
Share this question
or