static bool StackCompressWalkHelper(PermissionListSet compressedStack,
bool skipGrants,
PermissionSet grantedPerms,
PermissionSet deniedPerms,
FrameSecurityDescriptor frameInfo)
{
if (!skipGrants)
{
if (!compressedStack.AppendPermissions(grantedPerms,
PermissionList.MatchChecked))
{
return(false);
}
if (deniedPerms != null && !compressedStack.AppendPermissions(deniedPerms,
PermissionList.MatchDeny))
{
return(false);
}
}
if (frameInfo != null)
{
PermissionSet set = frameInfo.GetPermitOnly();
if (set != null)
{
if (!compressedStack.AppendPermissions(set, PermissionList.MatchPermitOnly))
{
return(false);
}
}
set = frameInfo.GetDenials();
if (set != null)
{
if (!compressedStack.AppendPermissions(set, PermissionList.MatchDeny))
{
return(false);
}
}
set = frameInfo.GetAssertions();
if (set != null)
{
if (!compressedStack.AppendPermissions(set, PermissionList.MatchAssert))
{
return(false);
}
}
}
return(true);
}