This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IsInherited flag in AclFileAttributeView

 
Reinier Labee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm using the AclFileAttributeView to loop through the ACL's of a set of Windows folders. Now I want to determine if an AclEntry is inherited from its parent or if it has been assigned directly to the folder. The Flags of a AclEntry object only show the inheritance behaviour of the AclEntry itself (DIRECTORY_INHERIT, FILE_INHERIT, INHERIT_ONLY and NO_PROPAGATE_INHERIT) not if the AclEntry has been inherited from its parent. In the Windows API (via script or VB app) you have the IsInherited flag to retrieve this information. Has anyone done this using Java?

Code:


Now the directory c:\test has Read permission for the user TestUser. The subdirectory Submap has WriteAttributes permission directly assigned to this user.

Result for: C:\Test
MyComputer\TestUser:READ_DATA/READ_NAMED_ATTRS/READ_ATTRIBUTES/READ_ACL/SYNCHRONIZE:FILE_INHERIT/DIRECTORY_INHERIT:ALLOW

Result for: C:\Users\Reinier\Test\Submap
MyComputer\TestUser:WRITE_ATTRIBUTES/SYNCHRONIZE:FILE_INHERIT/DIRECTORY_INHERIT:ALLOW
MyComputer\TestUser:READ_DATA/READ_NAMED_ATTRS/READ_ATTRIBUTES/READ_ACL/SYNCHRONIZE:FILE_INHERIT/DIRECTORY_INHERIT:ALLOW

I want to see that the Read permission on the Submap is inherited and not directly assigned. One option is to loop through all the parents to see if a similar permission has been assigned to the user, but that can become quite complicated and has an impact on the performance.

Thanks!
 
Reinier Labee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The flag I'm talking about is INHERITED_ACE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic