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

Attributes client-side or Permissions server-side

1 Answer 99 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 12 Oct 2009, 09:37 PM
Hi,

Using the FileExplorer, I want to control the permitted behaviour for each item (file or directory).

Basically I am implementing a directory browser with download capability  BUT I need to restrict what can be downloaded bsed on a combination of file attributes and which user is logged in.

Using a custom provider, I can add attributes (and additional columns) to the grid - one of these indicates visually to the user whether they can perform a download (i.e. all the logic has been applied to determine whether they can download the item).

I have further implemented a test in the "Handler" so that if the user does try to "open" the item they are ignored. However I would like to go further and catch the attempt on the client side (maybe pop-up a window saying not allowed).

  1. However I note that on the client, I can't seem to get to the additional attributes which have been defined (presumably I could go through some convoluted steps to get the grid and then get the column from it), surely a clientside "Get_Attribute(name)" method would make sense?
  2. I also note that I cna't set the permissions of the file item on the server side (e.g. whilst processing the file items in the custom provider I tried setting the permissions and discover that they are readonly). Woudl it not be sensible to be able to control permission on each file tiem individually?

Andrew

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 15 Oct 2009, 03:37 PM
Hello Andrew,

In reference to your questions :

  • For your convenience I have attached a working project to the thread. Please check it and let me know whether it fits you requirements?
  • You can set permissions to the FileBrowseritems in the constructor:
    DirectoryItem dirItem = new DirectoryItem("NAME", string.Empty, "FULL PATH", string.Empty, PathPermissions.Read | PathPermissions.Delete, fileItems, directoryItems);
    In the current implementation of the RadFileExplorer, however, all files that are immediate children to a folder have the same permissions set to that folder, regardless of the permissions set to the FILES. This is a problem in the RadFileExplorer control and we will fix it for one of the next releases.

Please do not hesitate to contact us if you have any further questions.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
FileExplorer
Asked by
Andrew
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or