Choose from image library when user has restricted permissions.
Hi there.
We have a bunch of editors who, despite being told several times, continue to upload images into a default library by neglecting to change it.
Is there was a way to force users to choose a library before being able to click 'Upload'?
I'm making this request for two reasons:
1) If like now, the editors have no restrictions on that library, they are (and will continue to do so, trust me) going to simply leave it as it is and upload their imagery there. This makes back end housekeeping a pain for our site administrators, something we want to simplify.
2) If editors have restricted permissions and this default library can only be edited, managed etc by administrators only, if they click 'Upload' without changing the library then they receive a rather messy error message (below) and have to repeat the process again as the 'Select an image' box is now, for lack of a better word, dead. (Screenshot attached)
"Telerik.Sitefinity.Libraries.Model.Album, Telerik.Sitefinity.Model was not granted ManageImage in Image for princupals with IDs 94cda633-4cae-6165-87ef-ff0000698116"
Forcing users to select a library instead of having one selected by default would solve this problem of ours.
If this isn't doable, is it instead possible to bounce an error message back to the user instead of an alert popup? Something along the lines of "You do not have permission to upload to this library, please select another".
Hello Chris,
You can inherit from ImageService and override the SaveChildContent method there. It is triggered when a user hits the upload button. The method accepts a parentId string which you can use to get the library into which the image is being uploaded, then you can for example throw an Exception and type a message that will come up as an alert screen for the user.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Sitefinity.Libraries.Model;
using Telerik.Sitefinity.Modules.Libraries.Web.Services;
using Telerik.Sitefinity.Web.Services;
namespace SitefinityWebApp
public class CustomImageService : ImageService
public override ContentItemContext<
Image
> SaveChildContent(ContentItemContext<
Image
> content, string parentId, string contentId, string providerName, string newParentId, string version, bool published, bool checkOut, string workflowOperation)
return base.SaveChildContent(content, parentId, contentId, providerName, newParentId, version, published, checkOut, workflowOperation);
<%@ ServiceHost
Language="C#"
Debug="false"
Service="SitefinityWebApp.CustomImageService"
Factory="Telerik.Sitefinity.Web.Services.WcfHostFactory"
%>