List of usage examples for org.apache.shiro.authc SimpleAccount getPrincipals
public PrincipalCollection getPrincipals()
From source file:at.pollux.thymeleaf.shiro.dialect.test.TestIniRealm.java
License:Apache License
@Override protected void add(SimpleAccount account) { String username = (String) account.getPrincipals().getPrimaryPrincipal(); // Let's add some additional principals for testing SimplePrincipalCollection principalCollection = new SimplePrincipalCollection(); principalCollection.addAll(account.getPrincipals()); principalCollection.add(counter.getAndIncrement(), "integerRealm"); TestObjPrincipal objPrinc = new TestObjPrincipal(username.toUpperCase() + " " + username.toUpperCase()); principalCollection.add(objPrinc, "objRealm"); account.setPrincipals(principalCollection); super.add(account); }
From source file:org.ms123.common.permission.MyRealm.java
License:Open Source License
protected String getUsername(SimpleAccount account) { return getUsername(account.getPrincipals()); }
From source file:org.zunpeng.thymeleaf.shiro.dialect.test.TestIniRealm.java
License:Apache License
@Override protected void add(SimpleAccount account) { String username = (String) account.getPrincipals().getPrimaryPrincipal(); // Let's add some additional principals for testing SimplePrincipalCollection principalCollection = new SimplePrincipalCollection(); principalCollection.addAll(account.getPrincipals()); principalCollection.add(counter.getAndIncrement(), "integerRealm"); TestObjPrincipal objPrinc = new TestObjPrincipal(username.toUpperCase() + " " + username.toUpperCase()); principalCollection.add(objPrinc, "objRealm"); account.setPrincipals(principalCollection); super.add(account); //To change body of generated methods, choose Tools | Templates. }