How to Check Access Rights of files
You can apply this logic by using GetNamedSecurityInfo function to another object type.