Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Setting document-level security
jasonb_UK
Hi there,
I'm using the SDK to write a module to update folder and document security within a mattercentric-enabled Worksite 8.2 content database.
I can identify the workspaces and folders I need to update easily enough, and update the security on these objects, but I'm trying to work out the best way of propagating this to the documents contained within the folders.
My initial thought was to search for all folders contained within a workspace by firstly creating a folders collection (based on the root folder) then iterate through this, but I'm prevented from using imFolderRootFolderID as a folder search parameter.
Is there an easy way to do this? I have to be able to retrospectively update the security on documents already profiled in a workspace.
Any suggestions gratefully received!
Find more posts tagged with
Comments
jny
If you use the IManRefileCmd Object, which is exposed by the IManExt2.dll, it will automate the updates by pushing both metadata and security changes from the target folder down to the document, like so:
Here's a code example on how to re-file documents by folder profile/sec:
[VB]
Option Explicit
Private Sub Form_Load()
Dim oDMS As New ManDMS
Dim oSess As IManSession
Dim oDoc As IManDocument
Dim oDox As IManDocuments
Dim oParms As IManFolderSearchParameters
Dim oFldr As IManFolder
Dim oManStrings As New ManStrings
Dim oCmd As IManRefileCmd
Dim oContext As ContextItems
Dim arrDox() As NRTDocument
Dim bRefresh
Dim i, ct As Long
Set oSess = oDMS.Sessions.Add("SERVERNAME")
oSess.TrustedLogin
oManStrings.Add oSess.PreferredDatabase.Name
Set oParms = oDMS.CreateFolderSearchParameters
oParms.Add imFolderName, "DOC PROFILED"
oParms.Add imFolderOwner, oSess.UserID
Set oFldr = oSess.WorkArea.SearchFolders(oManStrings,
oParms).ItemByIndex(1)
' Put documents contained in folder in a safe array
If Not oFldr.Contents Is Nothing Then
Set oDox = oFldr.Contents
ct = oDox.Count - 1
ReDim arrDox(0 to ct)
For i = 0 To ct
Set arrDox(i) = oDox(i+1)
Next i
End If
Set oCmd = New IManRefileCmd
Set oContext = New ContextItems
' Required
oContext.Add "ParentWindow", Me.hWnd
oContext.Add "SelectedIManObjects", arrDox
oContext.Add "SelectedContentsContainer", oFldr ' Target folder
' Optional
oContext.Add "ConfirmMessages", True
oContext.Add "IManExt2.RefileNoUI", True
oCmd.Initialize oContext
oCmd.Update
If oCmd.Status = (oCmd.Status And nrActiveCommand) Then
oCmd.Execute
bRefresh = oContext("IManExt.Refresh")
If bRefresh Then
MsgBox "Documents in folder, " & oFldr.Name & ", are refiled."
End If
End
End Sub