Shiro error: "the wildcard string cannot be empty or empty." Make sure the permission string is formatted correctly. "

The Debug in

permission list filterChainDefinitionMap is as follows:

clipboard.png

filterorg.apache.shiro.web.filter.AccessControlFilter:


subject.isPermittedDebug:

clipboard.png

error message:

java.lang.IllegalArgumentException: Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.

part of shiro source code:

protected void setParts(String wildcardString, boolean caseSensitive) {
        if (wildcardString != null && wildcardString.trim().length() != 0) {
            wildcardString = wildcardString.trim();
            List<String> parts = CollectionUtils.asList(wildcardString.split(":"));
            this.parts = new ArrayList();
            Iterator i$ = parts.iterator();

            while(i$.hasNext()) {
                String part = (String)i$.next();
                Set<String> subparts = CollectionUtils.asSet(part.split(","));
                if (!caseSensitive) {
                    subparts = this.lowercase(subparts);
                }

                if (subparts.isEmpty()) {
                    throw new IllegalArgumentException("Wildcard string cannot contain parts with only dividers. Make sure permission strings are properly formatted.");
                }

                this.parts.add(subparts);
            }

            if (this.parts.isEmpty()) {
                throw new IllegalArgumentException("Wildcard string cannot contain only dividers. Make sure permission strings are properly formatted.");
            }
        } else {
            throw new IllegalArgumentException("Wildcard string cannot be null or empty. Make sure permission strings are properly formatted."); //
        }
    }
The reason for

has been found, and the focus has been found wrong. the reason for the error is not judged in the place where individual permissions are obtained, but only in the addition of global permissions.

Menu