<div dir="ltr">Alan, I also had a hard time trying to figure it out. Part of the job of a good developer is to create expressive code (not just code that works, which is half the job at most, but code that can be easily understood and maintained).<div><br></div><div>With that goal in mind and using De Morgan as you propose, I would suggest:</div><div><br></div><div>$viewBelongsToCurrentUser = ($customViewOwner == $currentUser->getId());</div><div><br></div><div>if (!($currentUser->isAdminUser() || $viewBelongsToCurrentUser)) {</div><div>    throw new AppException("PERMISSION_DENIED");</div><div>}</div><div><br></div><div>I think the above is more "brain-friendly".</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Saludos<div><br></div><div>Rubén</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 9, 2021 at 4:44 AM Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Also to be remembered or statements are shortcutted sonic the first statement is true it'll execute the block. While in an AND it's shortcutted if the first statement is false.<div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il mer 9 giu 2021, 09:38 Alan Lord <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Comparing two not tests often throws me too and it turns out it's even a <br>
"thing".<br>
<br>
<a href="https://en.wikipedia.org/wiki/De_Morgan%27s_laws" rel="noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/De_Morgan%27s_laws</a><br>
<br>
>     not (A or B) = not A and not B<br>
>     not (A and B) = not A or not B.<br>
<br>
:-D<br>
<br>
On 09/06/2021 08:25, Alan Lord wrote:<br>
> Henry, good catch! It would be good to create a new ticket explaining <br>
> this bug and to create a Merge Request with the fix. If you are not <br>
> able, let this list know and I am sure one of us can do it on your behalf.<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>