Hi,
I had created a feature and activated in the SharePoint site using the Admin account. The feature was to count the number of files under each sub folder. The feature got activated successfully. I tested the code under the Admin account, and it was working.
I tried to test with other users, who had design and contribute access. But when the other users checked, the count was not showing. No errors were generated. This is the code I have used.
public static void GetOpenItems()
{
using (SPSite site = new SPSite(Constants.url))
{
using (SPWeb currentweb = site.OpenWeb())
{
SPListCollection mylists = currentweb.GetListsOfType(SPBaseType.DocumentLibrary);
for (int q = mylists.Count - 1; q >= 0; q--)
{
SPList list = mylists[q];
if (!list.Hidden)
{
currentweb.AllowUnsafeUpdates = true;
SPFolder folder = list.RootFolder;
SPView curview = list.DefaultView;
SPViewFieldCollection fieldCol = curview.ViewFields;
if (!fieldCol.Exists("FilesCount"))
{
AddField("FilesCount", SPFieldType.Text, list.Fields);
fieldCol.View.DefaultView = true;
curview.ViewFields.Add("FilesCount");
curview.Update();
}
int jouas = 0;
if (folder != null && folder.Name.CompareTo("Forms") != 0)
{
foreach (SPFolder subFolder in folder.SubFolders)
{
if (subFolder.Name.CompareTo("Forms") != 0)
{
jouas = GetItemsForFolderInt(subFolder);
subFolder.Item["FilesCount"] = jouas;
subFolder.Item.Update();
}
}
}
}
}
}
}
}
These are the steps I used to install the feature from dev environment to Production environment.
1) Copied the dll from GAC and pasted in Production server's GAC.
2) Copied the relevant feature folders from 12 hive and pasted in the corresponding 12 hive of production server
3) Used the Stsadm Install and Activate commands for the site.
Is there anything else I should be doing?
Please help.. I am not sure, what to do. The feature is working only for Admin account and not for users having other permissions.
Thank you.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.