On 7/21/2014 6:35 AM, Petr Vobornik wrote:
https://fedorahosted.org/freeipa/ticket/4380

This is the original if-condition:

   (!rights
    && !(that.flags.indexOf('w_if_no_aci') > -1
         && write_oc))
   || (rights && rights.indexOf('w') < 0)

Here if 'rights' has a value but there's no 'w' in it, the expression
will evaluate to true.

This is the new code:

   !can_write
   && !rights
   && !(that.flags.indexOf('w_if_no_aci') > -1 && write_oc)

Here if 'rights' has any value the expression will evaluate to false. Is
this correct?


You're right, there is an error. Attaching new version. The code is
rewritten to be more comprehensible - use cases are in separate variables.

ACK. The code now makes more sense.

--
Endi S. Dewata

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to