Home
TeamSite
security in folders dms
System
Hi all ,
We are watching the form to put this configuration in MailSite (DMS)
In DMS I want to create a folder with read/write access but I need that the documents with View access are created.
Is necessary to do generating it some template?
Is happened to you some way?
Thanks
Regards
Ricardo
Find more posts tagged with
Comments
jny
You may create a folder read/write. You may then create a document with default security of view (readonly) then add a reference of it to the folder.
[VB6]
Option Explicit
Private Sub Form_Load()
Dim dms As New ManDMS
Dim sess As IManSession
Dim db As IManDatabase
Dim fldrs As IManDocumentFolders
Dim fldr As IManDocumentFolder
Dim doc As IManDocument
Dim addeddoc As IManDocument
Dim fldrdox As IManDocuments
Dim results As IManCheckinResult
On Error GoTo Oops
Const sFileToImport = "C:/Temp/Test.doc"
' An example of a file to import to WorkSite
' Logon to a dms
Set sess = dms.Sessions.Add("MYSERVER")
sess.TrustedLogin
' Get target database in which to create a folder and import a document
Set db = sess.PreferredDatabase
' Create a new folder
Set fldrs = db.Root.SubFolders
Set fldr = fldrs.AddNewDocumentFolder("New Parent", "a new parent folder")
fldr.Security.DefaultVisibility = imPublic
fldr.Update
' Create a new document
Set doc = db.CreateDocument
' Check for required values: author, operator, class, subclass, type
If doc.GetAttributeByID(imProfileAuthor) = "" Then
doc.SetAttributeByID imProfileAuthor, sess.UserID
' Arbitrary example of an author is the current user
End If
If doc.GetAttributeByID(imProfileAuthor) = "" Then
doc.SetAttributeByID imProfileAuthor, sess.UserID
' Arbitrary example of an author is the current user
End If
If doc.GetAttributeByID(imProfileOperator) = "" Then
doc.SetAttributeByID imProfileOperator, sess.UserID
' Arbitrary example of an operator is the current user
End If
If doc.GetAttributeByID(imProfileType) = "" Then
doc.SetAttributeByID imProfileType, "WORD"
' Arbitrary example of an application type is "WORD"
End If
If doc.GetAttributeByID(imProfileClass) = "" Then
doc.SetAttributeByID imProfileClass, "DOC"
' Arbitrary example of a class is "DOC"
If True = doc.Class.SubClassRequired Then
' Require subclass
doc.SetAttributeByID imProfileSubClass, "CONTRACT"
' Arbitrary example of a subclass is "CONTRACT"
End If
End If
'NOTE: IManDatabase.SearchDocumentTypes can be used to search for IManDocumentType objects.
' IManDatabase.SearchDocumentClassse can be used to search for IManDocumentClass objects.
' IManDocumentClass.GetSubClasses can be used to find the required subclasses belonging to the specified class
' Set doc security to read-only
doc.Security.DefaultVisibility = imView
' Commit profile and file to the WorkSite database
Set results = doc.CheckInWithResults(sFileToImport, imCheckinNewDocument, imDontKeepCheckedOut)
If results.Succeeded Then
' Add the imported document to the folder
Set fldrdox = fldr.Contents
Set addeddoc = fldrdox.AddDocumentReference(doc)
MsgBox "Document " & addeddoc.Number & "_" & addeddoc.Version & _
" has been successfully added to " & UCase(fldr.Name) & " folder."
End If
GoTo Cleanup
Oops:
MsgBox Err.Description
Err.Clear
GoTo Cleanup
Cleanup:
If sess.Connected Then
sess.Logout
dms.Close
End If
Set results = Nothing
Set doc = Nothing
Set fldr = Nothing
Set fldrs = Nothing
Set db = Nothing
Set sess = Nothing
Set dms = Nothing
End
End Sub