public static boolean validateMorePermissive(FsAction first, FsAction second) {
    if ((first == FsAction.ALL) || (second == FsAction.NONE)
      || (first == second)) {
      return true;
    }
    switch (first) {
    case READ_EXECUTE:
      return ((second == FsAction.READ) || (second == FsAction.EXECUTE));
    case READ_WRITE:
      return ((second == FsAction.READ) || (second == FsAction.WRITE));
    case WRITE_EXECUTE:
      return ((second == FsAction.WRITE) || (second == FsAction.EXECUTE));
    }
    return false;
  }
Test if the first FsAction is more permissive than the second. This is
useful in cases where we want to ensure that a file owner has more
permissions than the group they belong to, for eg. More completely(but
potentially more cryptically) owner-r &gt;= group-r &gt;= world-r : bitwise
and-masked with 0444 =&gt; 444 &gt;= 440 &gt;= 400 &gt;= 000 owner-w &gt;= group-w &gt;=
world-w : bitwise and-masked with &amp;0222 =&gt; 222 &gt;= 220 &gt;= 200 &gt;= 000
owner-x &gt;= group-x &gt;= world-x : bitwise and-masked with &amp;0111 =&gt; 111 &gt;=
110 &gt;= 100 &gt;= 000

@return true if first FsAction is more permissive than the second, false
        if not.
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HCatUtil.java