<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 3, comments - 15, trackbacks - 0, articles - 26
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "<beans>
     
    <bean id="authenticationDao" class="net.sf.acegisecurity.providers.dao.jdbc.JdbcDaoImpl">
      <property name="dataSource"><ref bean="dataSource"/></property>
    </bean>

    <bean id="inMemoryDaoImpl" class="net.sf.acegisecurity.providers.dao.memory.InMemoryDaoImpl">
      <property name="userMap">
        <value>
          admin=admin,ROLE_TELLER,ROLE_SUPERVISOR   <!--用戶=密碼,角色,角色,-->
          dianne=emu,ROLE_TELLER
          scott=wombat,ROLE_TELLER
          peter=opal,disabled,ROLE_TELLER
        </value>
      </property>
    </bean>

    <!--##########類控制開始##########-->
    <bean id="bankManagerSecurity" class="net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
      <property name="validateConfigAttributes"><value>true</value></property>
      <property name="authenticationManager"><ref bean="authenticationManager"/></property><!--100行-->
      <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property><!--136行-->
      <property name="runAsManager"><ref bean="runAsManager"/></property>
      <!--<property name="afterInvocationManager"><ref bean="afterInvocationManager"/></property>-->
      <property name="objectDefinitionSource">
        <value>
           test.test1.delete*=ROLE_SUPERVISOR,ROLE_TELLER<!--控制 net.sf.acegisecurity.context.BankManager類的方法權(quán)限-->
           test.test1.getBalance=ROLE_TELLER
        </value>
      </property>
    </bean>
    <!--##########類控制結(jié)束##########-->

    <!--
    #################################################################################
    ###################http__authentication開始######################################
    ##################AuthenticationProcessingFilter#################################
    #################################################################################
    -->
    <!--

     -->

    <bean id="authenticationProcessingFilter" class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
      <property name="authenticationManager"><ref bean="authenticationManager"/></property>
      <property name="authenticationFailureUrl"><value>/login.jsp?login_error=1</value></property>
      <property name="defaultTargetUrl"><value>/success.jsp</value></property>
      <property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
    </bean>
    <!--
    #################################################################################
    ##################http__authentication結(jié)束########################################
    ##################AuthenticationProcessingFilter#################################
    #################################################################################
    -->

    <!--filter控制  要在web.xml中配置相應(yīng)的filter  HTTP REQUEST SECURITY-->
      <!--
         <filter>
         <filter-name>Acegi HTTP Request Security Filter</filter-name>
         <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
         <init-param>
         <param-name>targetClass</param-name>
         <param-value>net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter</param-value>
         </init-param>
         </filter>
         <filter-mapping>
         <filter-name>Acegi HTTP Request Security Filter</filter-name>
         <url-pattern>/*</url-pattern>
         </filter-mapping>
       -->

    <!--#################################################################################
    -->
    <bean id="securityEnforcementFilter"  class="net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter">
      <property name="filterSecurityInterceptor"><ref bean="filterInvocationInterceptor"/></property>
      <property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>
    </bean>

    <!--如果用戶沒有授權(quán) 則提醒用戶注冊  注冊頁面acegilogin.jsp-->
    <bean id="authenticationEntryPoint" class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
      <property name="loginFormUrl"><value>/login.jsp</value></property>
      <property name="forceHttps"><value>false</value></property>
    </bean>

    <bean id="filterInvocationInterceptor" class="net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor">
      <property name="authenticationManager"><ref bean="authenticationManager"/></property>
      <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
      <property name="runAsManager"><ref bean="runAsManager"/></property>
      <property name="objectDefinitionSource">
       <value>
        CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
        \A/secure/super/.*\Z=ROLE_TELLER
        \A/secure/.*\Z=ROLE_SUPERVISOR,ROLE_TELLER
       </value>
      </property>
    </bean>
    <!--#################################################################################
    -->

    <bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderManager">
       <property name="providers">
          <list>
             <ref bean="daoAuthenticationProvider"/>
          </list>
       </property>
       <property name="sessionController"><ref bean="concurrentSessionController"/></property><!--禁止同一帳號重復(fù)登陸系統(tǒng)(可選)-->
    </bean>

    <bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider">
       <property name="authenticationDao"><ref bean="authenticationDao"/></property><!--若屬性為inMemoryDaoImpl 則是存在內(nèi)存當(dāng)中的權(quán)限-->
       <property name="userCache"><ref local="userCache"/></property>
       <property name="passwordEncoder"><ref bean="passwordEncoder"/></property><!--密碼加密-->
    </bean>

    <bean id="userCache" class="net.sf.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
      <property name="cache"><ref local="userCacheBackend"/></property>
    </bean>

    <bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
       <property name="cacheManager">
      <ref local="cacheManager"/>
       </property>
       <property name="cacheName">
      <value>userCache</value>
       </property>
    </bean>  
    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/> 

    <bean id="concurrentSessionController" class="net.sf.acegisecurity.providers.ConcurrentSessionControllerImpl">
       <property name="maxSessions"><value>1</value></property>
    </bean>

     <!--定義一個驗(yàn)證方法-->
     <bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter"/>
       <!--具體的授權(quán)-->
     <bean id="accessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased">
         <property name="allowIfAllAbstainDecisions"><value>false</value></property>
      <property name="decisionVoters">
        <list>
          <ref bean="roleVoter"/>
        </list>
      </property>
     </bean>
     
    <bean id="passwordEncoder" class="net.sf.acegisecurity.providers.encoding.Md5PasswordEncoder"/><!--MD5法加密-->

     

    <!--頁面安全通道-->
    <bean id="channelProcessingFilter" class="net.sf.acegisecurity.securechannel.ChannelProcessingFilter">
      <property name="channelDecisionManager">
        <ref bean="channelDecisionManager"/>
      </property>
      <property name="filterInvocationDefinitionSource">
        <value>
          CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
          \A/sec/administrator.*\Z=REQUIRES_SECURE_CHANNEL
          \A/acegilogin.jsp.*\Z=REQUIRES_SECURE_CHANNEL
          \A/j_acegi_security_check.*\Z=REQUIRES_SECURE_CHANNEL
          \A.*\Z=REQUIRES_INSECURE_CHANNEL
        </value>
      </property>
    </bean>

    <bean id="channelDecisionManager" class="net.sf.acegisecurity.securechannel.ChannelDecisionManagerImpl">
      <property name="channelProcessors">
        <list>
          <ref bean="secureChannelProcessor"/>
          <ref bean="insecureChannelProcessor"/>
        </list>
      </property>
    </bean>
    <bean id="secureChannelProcessor" class="net.sf.acegisecurity.securechannel.SecureChannelProcessor"/>
    <bean id="insecureChannelProcessor" class="net.sf.acegisecurity.securechannel.InsecureChannelProcessor"/>
    <bean id="runAsManager" class="net.sf.acegisecurity.runas.RunAsManagerImpl">
       <property name="key"><value>my_run_as_password</value></property>
    </bean>
    </beans>


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: www.999精品视频观看免费| 无码一区二区三区AV免费| 免费一级毛片不卡在线播放| 亚洲一区二区影视| 免费黄色福利视频| 亚洲国产精品专区| 免费无码肉片在线观看| 亚洲欧洲AV无码专区| 免费无码又黄又爽又刺激| 亚洲avav天堂av在线网毛片| 四虎成人免费观看在线网址| 亚洲国产欧美日韩精品一区二区三区| 成人无遮挡裸免费视频在线观看| 亚洲精品无码中文久久字幕| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 亚洲精品国产手机| 国产大片91精品免费观看不卡| 亚洲精品乱码久久久久久下载| 亚洲高清免费在线观看| 亚洲一区二区三区高清不卡| 女人18毛片水真多免费看| 国产精品亚洲一区二区在线观看| 热久久精品免费视频| 三年片在线观看免费观看大全中国| 亚洲熟伦熟女新五十路熟妇 | 亚洲色欲色欲www在线丝 | 激情小说亚洲色图| 中文字幕亚洲不卡在线亚瑟| 无码A级毛片免费视频内谢| 2020亚洲男人天堂精品| 免费播放春色aⅴ视频| 永久免费av无码网站yy| 亚洲色图综合网站| 国产在线a不卡免费视频| 伊人久久大香线蕉免费视频| 亚洲欧洲日产国码www| 亚洲成a人在线看天堂无码| 久久精品国产影库免费看| 亚洲一区二区无码偷拍| 亚洲一区二区三区AV无码| 免费精品国产自产拍在线观看图片|