code: public boolean hasPermissionsById(String id, Collection<Permission> permissions) {
          AuthorizationInfo authorizationInfo = getAuthorizationInfoById(id);
          return authorizationInfo != null && isPermittedAll(permissions, authorizationInfo);
      }
docs: Test for whether an API key has specific permissions using its ID.