Sha256: 11a406d44d0417a323a86927be2ebafd7c6145c1fdc9ceebb08167d4cb79bdec

Contents?: true

Size: 405 Bytes

Versions: 16

Compression:

Stored size: 405 Bytes

Contents

function CheckFileAccessRules
{
  param($path, $identity, $rules)
  
  $result = $false
  $accessRules = (Get-Acl $path).access | Where-Object {$_.AccessControlType -eq 'Allow' -and $_.IdentityReference -eq $identity }
  if ($accessRules) {
    $match = $accessRules.FileSystemRights.ToString() -Split (', ') | ?{$rules -contains $_}
    $result = $match -ne $null -or $match.length -gt 0
  }
  $result
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
serverspec-0.10.6 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.10.5 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.10.4 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.10.3 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.10.2 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.10.1 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.10.0 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.8 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.7 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.6 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.5 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.4 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.3 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.2 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.1 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1
serverspec-0.9.0 lib/serverspec/backend/powershell/support/check_file_access_rules.ps1