Attributes client-side or Permissions server-side

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 12 Oct 2009 Link to this post

    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

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 15 Oct 2009 Link to this post

    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.
Back to Top