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

Enable ImangeManager for some, not for others...

2 Answers 34 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Avery
Top achievements
Rank 1
Avery asked on 01 May 2011, 07:27 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 04 May 2011, 01:07 PM
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.

0
Avery
Top achievements
Rank 1
answered on 05 May 2011, 11:39 PM
Great.  Thank you Dobromir.  I will try it out. 
Tags
Editor
Asked by
Avery
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Avery
Top achievements
Rank 1
Share this question
or