Package cn.dreampie.common.plugin.shiro.plugin

Source Code of cn.dreampie.common.plugin.shiro.plugin.JdbcRoleAuthzHandler

package cn.dreampie.common.plugin.shiro.plugin;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.subject.Subject;

/**
* Created by wangrenhui on 14-1-7.
*/
public class JdbcRoleAuthzHandler extends AbstractAuthzHandler {
  private final String jdbcRole;

  public JdbcRoleAuthzHandler(String jdbcRole) {
    this.jdbcRole = jdbcRole;
  }

  @Override
  public void assertAuthorized() throws AuthorizationException {
    Subject subject = getSubject();
    //数据库权限
    if (jdbcRole != null) {
      subject.checkRole(jdbcRole);
      return;
    }
  }
}
TOP

Related Classes of cn.dreampie.common.plugin.shiro.plugin.JdbcRoleAuthzHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.