I'm in the process of building an AJAX-y search for edit field in a larger form. The lookup needs to use IQA queries from a particular folder (configured property of my iPart).
I'm hitting a snag in the following part of the code. (code includes "using Asi.Business.Common") The error I'm getting (exception I'm catching) suggests I don't have permission to that folder, but the error message was in the sample code, so I'm not sure that's the real problem.
What am I missing to be able to do this? Or where should I be looking to find the problem?
string IQAFolder = "$/ContactManagement/DefaultSystem/Queries/Contacts";
Document document = DocumentController.Document(IQAFolder);
if (document.DocumentTypeCode.ToString() == "FOL")
{
Document[] queries = DocumentController.DocumentsInFolder(IQAFolder);
foreach (Document doc in queries)
{
RadComboBoxItem temp = new RadComboBoxItem();
temp.Text = doc.Description;
temp.Value = doc.DocumentVersionKey.ToString();
cbo.Items.Add(temp);
}
}
Is the code running in a
Is the code running in a context where it [or the user making the request] has already authenticated? If you're running inside the iMIS application (appserver, WCM server, public server, whatever) then it should already be.
Otherwise (or if GUEST doesn't have read access to the folder) you may need to authenticate yourself. Just add a using(Asi.Security.SecurityContext.ImpersonateAnonymous()) { ... } around your code. If GUEST doesn't have access, you can either a) force them to log in first, b) adjust the permissions on the folder [and all containing folders], or c) use Impersonate("MANAGER") instead, although this latter is not the recommended solution.
Also, the actual error message/stack trace would be more descriptive. ;)
Eric Means
System Architect, ASI