private static void grant(Connection connection, final String namespace, final String userName,
    boolean mergeExistingPermissions, final Permission.Action... actions) throws Throwable {
    connection.getAdmin().grant(
      new UserPermission(userName, Permission.newBuilder(namespace).withActions(actions).build()),
      mergeExistingPermissions);
  }
Grants permission on the specified namespace for the specified user.
@param connection               The Connection instance to use
@param namespace                the namespace
@param userName                 the user name
@param mergeExistingPermissions If set to false, later granted permissions will override
                                previous granted permissions. otherwise, it'll merge with
                                previous granted permissions.
@param actions                  the actions
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlClient.java