Example usage for org.apache.shiro.realm.text IniRealm setIni

List of usage examples for org.apache.shiro.realm.text IniRealm setIni

Introduction

In this page you can find the example usage for org.apache.shiro.realm.text IniRealm setIni.

Prototype

public void setIni(Ini ini) 

Source Link

Document

Sets the Ini instance used to configure this realm.

Usage

From source file:at.pollux.thymeleaf.shiro.dialect.test.TestIniSecurityManagerFactory.java

License:Apache License

@Override
protected Realm createRealm(Ini ini) {
    //IniRealm realm = new IniRealm(ini); changed to support SHIRO-322
    IniRealm realm = new TestIniRealm();
    realm.setName(INI_REALM_NAME);//from  ww w . ja v  a  2s  .  c o  m
    realm.setIni(ini); //added for SHIRO-322
    return realm;
}

From source file:io.bootique.shiro.realm.IniRealmFactory.java

License:Apache License

@Override
public Realm createRealm(Injector injector) {

    Ini ini = new Ini();

    if (users != null && !users.isEmpty()) {
        ini.addSection("users").putAll(users);
    }/*  ww  w.j a  v a  2s  .  co m*/

    if (roles != null && !roles.isEmpty()) {
        ini.addSection("roles").putAll(roles);
    }

    IniRealm realm = new IniRealm(ini);
    realm.setIni(ini);

    if (name != null) {
        realm.setName(name);
    }

    return realm;
}