public boolean authorizeUserNamespace(User user, String namespace, Permission.Action action) {
    if (user == null) {
      return false;
    }
    if (authorizeUserGlobal(user, action)) {
      return true;
    }
    PermissionCache<NamespacePermission> nsPermissions =
      namespaceCache.getOrDefault(namespace, NS_NO_PERMISSION);
    if (authorizeNamespace(nsPermissions.get(user.getShortName()), namespace, action)) {
      return true;
    }
    for (String group : user.getGroupNames()) {
      if (authorizeNamespace(nsPermissions.get(AuthUtil.toGroupEntry(group)), namespace, action)) {
        return true;
      }
    }
    return false;
  }
Check if user has given action privilige in namespace scope.
@param user      user name
@param namespace namespace
@param action    one of action in [Read, Write, Create, Exec, Admin]
@return true if user has, false otherwise
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java