public static ListMultimap<String, Permission>
    toUserTablePermissions(AccessControlProtos.UsersAndPermissions proto) {
    ListMultimap<String, Permission> perms = ArrayListMultimap.create();
    AccessControlProtos.UsersAndPermissions.UserPermissions userPerm;
    for (int i = 0; i < proto.getUserPermissionsCount(); i++) {
      userPerm = proto.getUserPermissions(i);
      for (int j = 0; j < userPerm.getPermissionsCount(); j++) {
        Permission perm = toPermission(userPerm.getPermissions(j));
        perms.put(userPerm.getUser().toStringUtf8(), perm);
      }
    }
    return perms;
  }
Convert a shaded protobuf UserTablePermissions to a ListMultimap&lt;String, TablePermission&gt;
where key is username.
@param proto the protobuf UserPermission
@return the converted UserPermission
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/ShadedAccessControlUtil.java