|
<%
SPListCollection spLists = spWeb.Lists;
int iIndex = 0;
System.Collections.Generic.SortedList assetLibs = new System.Collections.Generic.SortedList();
System.Collections.Generic.SortedList notAssetLibs = new System.Collections.Generic.SortedList();
for (int i = 0 ;i < spLists.Count ;i++)
{
SPList spList = spLists[i];
SPDocumentLibrary spDocLib = spList as SPDocumentLibrary;
if ((!spList.Hidden) && (spList.BaseType == SPBaseType.DocumentLibrary) && spDocLib != null && !spDocLib.IsCatalog && (spList.BaseTemplate != SPListTemplateType.PictureLibrary))
{
bool bHasPermission = false;
bool oldState = SPSecurity.CatchAccessDeniedException;
try
{
SPSecurity.CatchAccessDeniedException = false;
bHasPermission = spList.DoesUserHavePermissions(SPBasePermissions.AddListItems);
}
catch (UnauthorizedAccessException)
{
}
finally
{
SPSecurity.CatchAccessDeniedException = oldState;
}
if (bHasPermission)
{
bDocLibAvailable = true;
if (spList.IsSiteAssetsLibrary)
{
assetLibs.Add(spList.Title, spList);
}
else
{
notAssetLibs.Add(spList.Title, spList);
}
}
}
}
foreach(System.Collections.Generic.KeyValuePair oneEntry in assetLibs)
{
if (iIndex == 0)
{
%>
|
<%
if (iIndex == 0 && spWeb.DoesUserHavePermissions(SPBasePermissions.ManageLists))
{
%>