public boolean allowLoginAdministrative()

in src/main/java/org/apache/sling/jcr/base/internal/LoginAdminAllowList.java [98:127]


    public boolean allowLoginAdministrative(Bundle b) {
        // create local copy of ConfigurationState to avoid reading mixed configurations during an configure
        final ConfigurationState localConfig = this.config;
        if (localConfig == null) {
            throw new IllegalStateException("LoginAdminAllowList has no configuration.");
        }

        if(localConfig.bypassAllowList) {
            LOG.debug("Allow list is bypassed, all bundles allowed to use loginAdministrative");
            return true;
        }

        final String bsn = b.getSymbolicName();

        if(localConfig.allowListRegexp != null && localConfig.allowListRegexp.matcher(bsn).matches()) {
            LOG.debug("{} is allow listed to use loginAdministrative, by regexp", bsn);
            return true;
        }

        for (final AllowListFragment fragment : allowListFragments) {
            if (fragment.allows(bsn)) {
                LOG.debug("{} is allow listed to use loginAdministrative, by allow list fragment '{}'",
                        bsn, fragment);
                return true;
            }
        }

        LOG.debug("{} is not allow listed to use loginAdministrative", bsn);
        return false;
    }