def disinherit(name, objectType, copy_inherited_acl=True):
 ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''}
 tRet = __salt__['win_dacl.check_inheritance'](name, objectType)
 if tRet['result']:
  if tRet['Inheritance']:
   if __opts__['test']:
    ret['result'] = None
    ret['changes']['Inheritance'] = 'Disabled'
    ret['comment'] = 'Inheritance is set to be disabled.'
    ret['changes']['Inherited ACLs'] = ('Are set to be kept' if copy_inherited_acl else 'Are set to be removed')
    return ret
   eRet = __salt__['win_dacl.disable_inheritance'](name, objectType, copy_inherited_acl)
   ret['result'] = eRet['result']
   if eRet['result']:
    ret['changes'] = dict(ret['changes'], **eRet['changes'])
   else:
    ret['comment'] = ' '.join([ret['comment'], eRet['comment']])
  elif __opts__['test']:
   ret['result'] = None
   ret['comment'] = 'Inheritance is disabled.'
 else:
  ret['result'] = False
  ret['comment'] = tRet['comment']
 return ret

def disinherit ( name , objectType , copy_inherited_acl = True ) : ret = { 'name' : name , 'result' : True , 'changes' : { } , 'comment' : '' } tRet = __salt__ [ 'win_dacl.check_inheritance' ] ( name , objectType ) if tRet [ 'result' ] : if tRet [ 'Inheritance' ] : if __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'changes' ] [ 'Inheritance' ] = 'Disabled' ret [ 'comment' ] = 'Inheritance is set to be disabled.' ret [ 'changes' ] [ 'Inherited ACLs' ] = ( 'Are set to be kept' if copy_inherited_acl else 'Are set to be removed' ) return ret eRet = __salt__ [ 'win_dacl.disable_inheritance' ] ( name , objectType , copy_inherited_acl ) ret [ 'result' ] = eRet [ 'result' ] if eRet [ 'result' ] : ret [ 'changes' ] = dict ( ret [ 'changes' ] , ** eRet [ 'changes' ] ) else : ret [ 'comment' ] = ' ' . join ( [ ret [ 'comment' ] , eRet [ 'comment' ] ] ) elif __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'Inheritance is disabled.' else : ret [ 'result' ] = False ret [ 'comment' ] = tRet [ 'comment' ] return ret
ensure an object is not inheriting acls from its parent .