Example usage for org.apache.shiro.realm.text TextConfigurationRealm setRoleDefinitions

List of usage examples for org.apache.shiro.realm.text TextConfigurationRealm setRoleDefinitions

Introduction

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

Prototype

public void setRoleDefinitions(String roleDefinitions) 

Source Link

Document

Sets a newline (\n) delimited String that defines role-to-permission definitions.

Usage

From source file:com.stormpath.shiro.spring.boot.autoconfigure.ShiroAutoConfigurationTestApplication.java

License:Apache License

@Bean
@SuppressWarnings("Duplicates")
Realm getTextConfigurationRealm() {/*from w w w  .  j ava  2 s. c o  m*/

    TextConfigurationRealm realm = new TextConfigurationRealm();
    realm.setUserDefinitions("joe.coder=password,user\n" + "jill.coder=password,admin");

    realm.setRoleDefinitions("admin=read,write\n" + "user=read");
    realm.setCachingEnabled(true);
    return realm;
}

From source file:com.stormpath.shiro.spring.config.RealmConfiguration.java

License:Apache License

@Bean
@DependsOn("lifecycleBeanPostProcessor")
@SuppressWarnings("Duplicates")
Realm getTextConfigurationRealm() {//from  w ww . j a  v  a  2s .c om

    TextConfigurationRealm realm = new TextConfigurationRealm();
    realm.setUserDefinitions("joe.coder=password,user\n" + "jill.coder=password,admin");

    realm.setRoleDefinitions("admin=read,write\n" + "user=read");
    realm.setCachingEnabled(true);
    return realm;
}