Access Denied Error when altering ContentStartingPath parameter for DialogConfiguration

Russell Royer asked on November 13, 2015 18:42

When setting the parameter ContentStartingPath on DialogConfiguration for opening a Dialog box, I am getting an Access Denied error when I try to open it. If I leave the parameter the default value or set it blank, it will work fine and open at the site root. But any attempt to set a path (even just "/") results in an Access Denied error when the box opens with no error or feedback in the Event Log.

The user should have full admin rights and I cannot find any permissions for any node that looks like a conflict. Is there some special path rules that I need to follow or some kind of setting that I am ignorant of?

Correct Answer

Timothy Fenton answered on December 3, 2015 18:51

Hello again Russell, so after investigating this it appears it is because you are not encoding this value so it is simply adding it to the querystring as path=/ which obviously is not valid. As soon as you encode the path you put there it will start working. Something like this:

mConfig.ContentStartingPath = CMSDialogHelper.EncodeQueryString("/");

would work perfectly.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Timothy Fenton answered on November 16, 2015 12:13

Hello Russell, which version of Kentico are you using, version / hotfix? I know there were bugs similar to this in the past

0 votesVote for this answer Mark as a Correct answer

Russell Royer answered on November 19, 2015 00:06

Hi Timothy, I'm using Kentico version 7 hotfix 30. Is that perchance something that was hotfixed in v7?

0 votesVote for this answer Mark as a Correct answer

Russell Royer answered on November 20, 2015 19:00

I patched our instances all the way up to 7.0.103 and the error still persists. Is there any other solutions out there?

0 votesVote for this answer Mark as a Correct answer

Timothy Fenton answered on November 23, 2015 10:44

hello russell, thanks for that - can you send me a code snippet of the code you are using for this. Also are you doing this in a custom control or a custom webpart or some place else?

Thanks

0 votesVote for this answer Mark as a Correct answer

Russell Royer answered on November 24, 2015 21:40

I am building a custom control based on code from the Select Document Form control (CMSModules_Content_FormControls_Documents_SelectDocument). The error is reproducible in the existing form control when the ContentStartingPath parameter is changed like the following:

private DialogConfiguration Config
{
    get
    {
        if (mConfig == null)
        {
            mConfig = new DialogConfiguration();
            mConfig.HideLibraries = true;
            mConfig.HideAnchor = true;
            mConfig.HideAttachments = true;
            mConfig.HideContent = false;
            mConfig.HideEmail = true;
            mConfig.HideLibraries = true;
            mConfig.HideWeb = true;
            mConfig.EditorClientID = txtGuid.ClientID;
            mConfig.ContentSelectedSite = CMSContext.CurrentSiteName;
            mConfig.OutputFormat = OutputFormatEnum.Custom;
            mConfig.CustomFormatCode = "selectpath";
            mConfig.SelectableContent = SelectableContentEnum.AllContent;
            mConfig.ContentStartingPath = "/";
        }
        return mConfig;
    }
}
0 votesVote for this answer Mark as a Correct answer

Russell Royer answered on December 1, 2015 23:29 (last edited on December 1, 2015 23:29)

Does anybody know if this is intended behavior, if there is some document or user settings that are causing the Access Denied error, or if this is an unfixed bug? The error can be replicated by editing the "Select Document" Form Control and adding the ContentStartingPath parameter to the DialogConfiguration object.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.