How to permission files and folders separately?

6 posts, 0 answers
  1. Mark
    Mark avatar
    8 posts
    Member since:
    Nov 2008

    Posted 23 Sep 2010 Link to this post

    I have the following permissions set in a table in a database.

    1. Create files
    2. Delete files
    3. Create folders
    4. Delete folders
    5. Full

    I know you can set the permissions for create and delete for folders and files (using code below), but I can't see how to separate them - i.e. enabled only file creation, and not folder creation?

    RadFileExplorer1.Configuration.ViewPaths = paths;
    RadFileExplorer1.Configuration.UploadPaths = paths;
    RadFileExplorer1.Configuration.DeletePaths = paths;

    Do I have to extend the FileSystemContentProvider?  If so, is there some code to help me along my way?  I have looked at http://www.telerik.com/help/aspnet-ajax/radfileexplorer-custom-filebrowsercontentprovider.html but that doesn't really clear things up for me.

    Thanks,
    Mark
  2. Jed
    Jed avatar
    16 posts
    Member since:
    Apr 2009

    Posted 23 Sep 2010 Link to this post

    I would read up these two pages:

    http://www.telerik.com/help/aspnet-ajax/radfileexplorer-server-side-programming.html

    and

    http://www.telerik.com/help/aspnet-ajax/radfileexplorer-client-side.html

    you can also do things like:

    C#

    RadFileExplorer.ToolBar.Items.FindItemByText("Upload").Visible = false;
    RadFileExplorer.GridContextMenu.FindItemByText("Upload").Visible = false;
    RadFileExplorer.TreeView.ContextMenus[0].FindItemByText("Upload").Visible = false;

    JavaScript

    function OnClientFolderChange(fileExplorer, args) {
         var toolbar = fileExplorer.get_toolbar();
         var tbModify = toolbar.findItemByValue("Upload");
         tbModify.hide(); // hide the upload button
    }


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark
    Mark avatar
    8 posts
    Member since:
    Nov 2008

    Posted 28 Sep 2010 Link to this post

    Thanks, but RadFileExplorer.ToolBar.Items.FindItemByText("Upload").Visible = false; only works for Upload.  Neither of the other buttons seem to use the text property.  How would I disabled the other toolbar buttons?
  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 28 Sep 2010 Link to this post

    Hello Mark,

    I believe that this KB article will be of help.


    Regards,
    Fiko
    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
  6. Mark
    Mark avatar
    8 posts
    Member since:
    Nov 2008

    Posted 28 Sep 2010 Link to this post

    Thanks Fiko.  That is what I am after.  However, this covers deleting an item - how do I add an item back into the collection once it has been removed?

    For my requirements I need to remove all the items from the toolbar by looping through the ToolBar.Items collection, then check which permission the user should have, and then add back in the relevant items. 

    At the moment I have this working by looping through the ToolBar.Items collection and hiding the items using CSS display:none, and then looping through the collection and only showing the applicable items based on the user's permissions.  However, I would like to remove the items rather than just hiding them.

    Thanks,
    Mark
  7. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 01 Oct 2010 Link to this post

    Hi Mark,

    In your case I recommend you to first hide the RadToolBar's items by setting their Visible="false" properties and then enable those you want by setting their Visible properties to "true".

    Regards,
    Fiko
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017