Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Cannot set security
rjb09
Hi,
I am using the 8.5 client.
I am trying to setup the security for new documents to inherit its parent's security.
so the code is pretty simple document.Security.Inherited = true;
document.Update();
the problem is, I get an invalid profile error.
the Security property is read only for document, but I can't figure out how to set it up.
Find more posts tagged with
Comments
TomH006
We do this in our VBA project, get the folder object, if the folder security is <> Public we change the doc security to the folders
Hope this helps....
Public Sub InheritSecurity(objDoc As IManDocument)
Dim ofolder As NRTFolder
Dim oSearchParams As IManProfileSearchParameters
Dim oWSSearchParams As IManWorkspaceSearchParameters
Set oSearchParams = oDMS.CreateProfileSearchParameters
Set oWSSearchParams = oDMS.CreateWorkspaceSearchParameters
Dim wkspace As IManWorkspace
Dim oFolders As NRTFolders
oSearchParams.Add imProfileCustom1, objDoc.GetAttributeByID(imProfileCustom1)
oSearchParams.Add imProfileCustom2, objDoc.GetAttributeByID(imProfileCustom2)
Set oFolders = objDoc.database.SearchWorkspaces(oSearchParams, oWSSearchParams)
Set ofolder = oFolders.Item(1)
If (ofolder.Security.DefaultSecurity <> nrPublic) Then
objDoc.Security.DefaultVisibility = ofolder.Security.DefaultSecurity
objDoc.Update
objDoc.Refresh
End If