Logo Home   Documents & Lists   Site Settings   Help   
SharePoint Support
Common User Issues: Top Level
Post Reply Post Reply
Edit Edit Message
Delete Delete Message
Alert Me
Go Back to Discussion Board
Posted At: 12/10/2004 7:43 AM
Top Level
You should use the allow class:
Example (extract all documents in Sharepoint Portal)
Dim globalAdmin As New SPGlobalAdmin
                Dim uri As New System.Uri("http://srvsp2003")
                Dim virtualServer As SPVirtualServer = globalAdmin.OpenVirtualServer(uri)
                Dim siteCollections As SPSiteCollection = virtualServer.Sites
                Dim myspsite As SPSite
                For Each myspsite In siteCollections  'recorrido de sitios
                    Dim userHasRights As Boolean = True
                    Dim sites As SPWebCollection = myspsite.AllWebs
                    Dim site As SPWeb
                    For Each site In sites
                        Dim lists As SPListCollection = site.Lists
                        Dim list As SPList
                        For Each list In lists
                            If list.BaseType = SPBaseType.DocumentLibrary Then
                                Dim docLibrary As SPDocumentLibrary = CType(list, SPDocumentLibrary)
                                If Not docLibrary.IsCatalog Then
                                    If list.BaseTemplate <> SPListTemplateType.XMLForm Then
                                        Dim docLibItems As SPListItemCollection = docLibrary.Items
                                        Dim docLibItem As SPListItem
                                        For Each docLibItem In docLibItems
                                            Dim File As SPFile = docLibItem.File
                                            If Not File.Properties.Item("IdentificadorDoc") Is Nothing Then
                                                If CStr(File.Properties.Item("IdentificadorDoc")) = Trim(Page.Request.QueryString("Param")) Then
                                                    Page.Response.Redirect(myspsite.Url.ToString & "/" & File.Url.ToString)
                                                    Exit Try
                                                End If
                                            End If
                                        Next docLibItem
                                    End If
                                End If
                            End If
                        Next list
                    Next site
Created at 12/10/2004 7:43 AM by
Last modified at 12/10/2004 7:43 AM by