public interface PermissionResolver
PermisisonResolverresolves a String value and converts it into a
Permissioninstance. The default
WildcardPermissionResolvershould be suitable for most purposes, which constructs
WildcardPermissionobjects. However, any resolver may be configured if an application wishes to use different
PermissionResolveris used by many Shiro components such as annotations, property file configuration, URL configuration, etc. It is useful whenever a String representation of a permission is specified and that String needs to be converted to a Permission instance before executing a security check. Shiro chooses to support
Wildcardpermissions by default in almost all components and we do that in the form of the
WildcardPermissionResolver. One of the nice things about
WildcardPermissions being supported by default is that it makes it very easy to store complex permissions in the database - and also makes it very easy to represent permissions in JSP files, annotations, etc., where a simple string representation is useful. Although this happens to be the Shiro default, you are of course free to provide custom String-to-Permission conversion by providing Shiro components any instance of this interface.
Permission resolvePermission(String permissionString)
permissionString- the String representation of a permission.
InvalidPermissionStringException- if the permission string is not valid for this resolver.
Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.