public boolean allowLoginAdministrative()

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


    public boolean allowLoginAdministrative(Bundle b) {
        if (config == null) {
            throw new IllegalStateException("LoginAdminWhitelist has no configuration.");
        }
        // create local copy of ConfigurationState to avoid reading mixed configurations during an configure
        final ConfigurationState localConfig = this.config;
        if(localConfig.bypassWhitelist) {
            LOG.debug("Whitelist is bypassed, all bundles allowed to use loginAdministrative");
            return true;
        }

        final String bsn = b.getSymbolicName();

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

        for (final WhitelistFragment fragment : whitelistFragments) {
            if (fragment.allows(bsn)) {
                LOG.debug("{} is whitelisted to use loginAdministrative, by whitelist fragment '{}'",
                        bsn, fragment);
                return true;
            }
        }

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