Enable ImangeManager for some, not for others...

3 posts, 1 answers
  1. Avery
    Avery avatar
    8 posts
    Member since:
    Aug 2010

    Posted 01 May 2011 Link to this post

    Hello,

    I would like to disable the ImageManager for certain users of my site and display a message accordingly when they click on the button.  Is that possible?

    Example: A membership site where premium members can upload and manage photos in the editors but a normal user cannot and sees a message telling them to upgrade membership.

    Hope it's possible.  Thank you!

  2. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 04 May 2011 Link to this post

    Hi Avery,

    RadEditor does not offer the required functionality out of the box. However, you can achieve the required functionality by assigning a handler to the ClientCommandExecuting client-side event of the RadEditor to check whether the user has permission or not and proceed with the command execution or cancel it accordingly, .e.g:
    <telerik:RadEditor id="RadEditor1" runat="server" OnClientCommandExecuting="OnClientCommandExecuting">
        <ImageManager ViewPaths="~/Images" />
    </telerik:RadEditor>
     
    <script type="text/javascript">
        function OnClientCommandExecuting(editor, args)
        {
            if(args.get_commandName() == "ImageManager")
            {
                 if(!userHasPermission) //userHasPermission is a custom boolean variable containing information regarding the user
                 {
                     args.set_cancel(true); //cancel further execution
                     alert("You do not have permission to use ImageManager");
                 }
            }
        }
    </script>

    Please note that this is just an example and need to be extended in order to match the exact scenario.

    Regards,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Avery
    Avery avatar
    8 posts
    Member since:
    Aug 2010

    Posted 05 May 2011 Link to this post

    Great.  Thank you Dobromir.  I will try it out. 
Back to Top