This constructor will immediately process the definitions in the {@code Ini} argument. If you need to perform additional configuration before processing (e.g. setting a permissionResolver, etc), do not call this constructor. Instead, do the following: <ol> <li>Call the default no-arg constructor</li> <li>Set the Ini instance you wish to use via {@code #setIni}</li> <li>Set any other configuration properties</li> <li>Call {@link #init()}</li> </ol>
This constructor will immediately process the definitions in the {@code Ini} resolved from the specified {@code resourcePath}. If you need to perform additional configuration before processing (e.g. setting a permissionResolver, etc), do not call this constructor. Instead, do the following: <ol> <li>Call the default no-arg constructor</li> <li>Set the Ini instance you wish to use via {@code #setIni}</li> <li>Set any other configuration properties</li> <li>Call {@link #init()}</li> </ol>
Returns the Ini instance used to configure this realm. Provided for JavaBeans-style configuration of this realm, particularly useful in Dependency Injection environments.
Sets the Ini instance used to configure this realm. Provided for JavaBeans-style configuration of this realm, particularly useful in Dependency Injection environments.
Will call 'processDefinitions' on startup.
<p>Sets a newline (\n) delimited string that defines user-to-password-and-role(s) key/value pairs according to the following format: <p/> <p><code><em>username</em> = <em>password</em>, role1, role2,...</code></p> <p/> <p>Here are some examples of what these lines might look like:</p> <p/> <p><code>root = <em>reallyHardToGuessPassword</em>, administrator<br/> jsmith = <em>jsmithsPassword</em>, manager, engineer, employee<br/> abrown = <em>abrownsPassword</em>, qa, employee<br/> djones = <em>djonesPassword</em>, qa, contractor<br/> guest = <em>guestPassword</em></code></p>
Sets a newline (\n) delimited string that defines role-to-permission definitions. <p/> <p>Each line within the string must define a role-to-permission(s) key/value mapping with the equals character signifies the key/value separation, like so:</p> <p/> <p><code><em>rolename</em> = <em>permissionDefinition1</em>, <em>permissionDefinition2</em>, ...</code></p> <p/> <p>where <em>permissionDefinition</em> is an arbitrary string, but must people will want to use Strings that conform to the {@link hunt.shiro.authz.permission.WildcardPermission WildcardPermission} format for ease of use and flexibility. Note that if an individual <em>permissionDefinition</em> needs to be internally comma-delimited (e.g. <code>printer:5thFloor:print,info</code>), you will need to surround that definition with double quotes (") to avoid parsing errors (e.g. <code>"printer:5thFloor:print,info"</code>). <p/> <p><b>NOTE:</b> if you have roles that don't require permission associations, don't include them in this definition - just defining the role name in the {@link #setUserDefinitions(string) userDefinitions} is enough to create the role if it does not yet exist. This property is really only for configuring realms that have one or more assigned Permission.
A {@link hunt.shiro.realm.Realm Realm} implementation that creates {@link hunt.shiro.authc.SimpleAccount SimpleAccount} instances based on {@link Ini} configuration. <p/> This implementation looks for two {@link IniSection sections} in the {@code Ini} configuration: <pre> users
# One or more {@link hunt.shiro.realm.text.TextConfigurationRealm#setUserDefinitions(string) user definitions} ... roles
# One or more {@link hunt.shiro.realm.text.TextConfigurationRealm#setRoleDefinitions(string) role definitions}</pre> <p/> This class also supports setting the {@link #setResourcePath(string) resourcePath} property to create account data from an .ini resource. This will only be used if there isn't already account data in the Realm.