#85 spring mvc taglib的checkbox, radio 支持twitter bootstrap
This commit is contained in:
+12
-7
@@ -64,15 +64,20 @@ public class ShiroDbRealm extends AuthorizingRealm {
|
||||
*/
|
||||
@Override
|
||||
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
|
||||
ShiroUser shiroUser = (ShiroUser) principals.fromRealm(getName()).iterator().next();
|
||||
User user = accountService.findUserByLoginName(shiroUser.loginName);
|
||||
if (user != null) {
|
||||
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
||||
info.addRoles(user.getRoleList());
|
||||
return info;
|
||||
} else {
|
||||
Object principal = principals.getPrimaryPrincipal();
|
||||
if (principal == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ShiroUser shiroUser = (ShiroUser) principal;
|
||||
User user = accountService.findUserByLoginName(shiroUser.loginName);
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
||||
info.addRoles(user.getRoleList());
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@ public class QuickStartServer {
|
||||
public static final int PORT = 8080;
|
||||
public static final String CONTEXT = "/quickstart";
|
||||
public static final String BASE_URL = "http://localhost:8080/quickstart";
|
||||
public static final String[] TLD_JAR_NAMES = new String[] { "sitemesh", "spring-webmvc", "shiro-web" };
|
||||
public static final String[] TLD_JAR_NAMES = new String[] { "sitemesh", "spring-webmvc", "shiro-web",
|
||||
"springside-core" };
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
//设定Spring的profile
|
||||
|
||||
Reference in New Issue
Block a user