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)
WorkSite SDK - Retrieving Security Access Info
abRussB
Anyone know how to grab User Security Info on a document? I think I'm on the right track with the code below, but it's not exactly right. I'm trying to get the users who have access to a doc and what that access level is (No Access, Full Access, Read, Read/Write).
Dim objDocSecurity As IManSecurity
'item is a valid IManDocument object.
Dim oSecurity As IManSecurity = item.Security
‘ Iterate through the Security List
For i = 1 To oSecurity.UserACLs.Count
objDocSecurity = item.Security.UserACLs.ItemByIndex(i)
Next i
Find more posts tagged with
Comments
abRussB
Got it.
Dim objDocSecurity As IManUserACL
'item is a valid IManDocument object.
Dim oSecurity As IManSecurity = item.Security
‘ Iterate through the User Security List
For i = 1 To oSecurity.UserACLs.Count
objDocSecurity = item.Security.UserACLs.ItemByIndex(i)
strDocSecurityInfo = objDocSecurity.User.FullName
Next i
Migrateduser
What about with a iManFolder object? I am trying the same thing, and I am getting the Default Visibility, but the UserACL and GroupACL collections are always empty. Here is a sample function that is designed to recurse up an inheritance tree to find the "boss" object and pass back the iManSecurity object:
Private Function FindMySecurity(pFolder As iManFolder) As IManSecurity
If pFolder.Security.Inherited = True Then
Set FindMySecurity = FindMySecurity(pFolder.Parent)
Else
Set FindMySecurity = pFolder.Security
' At this point, the ACL collections are blank, so I tried this, which still doesn't work!
Dim gACL As IManGroupACL
Dim uACL As IManUserACL
For Each gACL In pFolder.Security.GroupACLs
FindMySecurity.GroupACLs.add gACL.Group.Name, gACL.Right
Next gACL
For Each uACL In pFolder.Security.UserACLs
FindMySecurity.UserACLs.add uACL.User.Name, uACL.Right
Next uACL
End If
End Function
Any suggestions?