first commit
This commit is contained in:
23
comm/Security/build/classes/security/mapping/Resource.hbm.xml
Executable file
23
comm/Security/build/classes/security/mapping/Resource.hbm.xml
Executable file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
||||
<hibernate-mapping>
|
||||
<class name="security.Resource" table="SCT_RESOURCE">
|
||||
<id name="id" type="java.lang.String">
|
||||
<column name="UUID" />
|
||||
<generator class="uuid.hex" />
|
||||
</id>
|
||||
<property name="resString" type="java.lang.String">
|
||||
<column name="RES_STRING" length="256" not-null="true" />
|
||||
</property>
|
||||
<property name="resType" type="java.lang.String">
|
||||
<column name="RES_TYPE" length="32" not-null="true" />
|
||||
</property>
|
||||
<set cascade="none" lazy="false" name="roles"
|
||||
outer-join="false" sort="unsorted" table="SCT_ROLE_RESOURCE">
|
||||
<key column="RESOURCE_UUID" />
|
||||
<many-to-many class="security.Role"
|
||||
column="ROLE_UUID" unique="false" />
|
||||
</set>
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
24
comm/Security/build/classes/security/mapping/Role.hbm.xml
Executable file
24
comm/Security/build/classes/security/mapping/Role.hbm.xml
Executable file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
||||
<hibernate-mapping>
|
||||
<class name="security.Role" table="SCT_ROLE">
|
||||
<id name="id" type="java.lang.String">
|
||||
<column name="UUID" />
|
||||
<generator class="uuid.hex" />
|
||||
</id>
|
||||
<property generated="never" lazy="false" name="roleName"
|
||||
type="java.lang.String">
|
||||
<column length="64" name="ROLE_NAME" />
|
||||
</property>
|
||||
|
||||
<set cascade="none" lazy="false" name="resources"
|
||||
outer-join="false" sort="unsorted" table="SCT_ROLE_RESOURCE">
|
||||
<key column="ROLE_UUID" />
|
||||
<many-to-many class="security.Resource"
|
||||
column="RESOURCE_UUID" unique="false" />
|
||||
</set>
|
||||
|
||||
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
49
comm/Security/build/classes/security/mapping/SecUser.hbm.xml
Executable file
49
comm/Security/build/classes/security/mapping/SecUser.hbm.xml
Executable file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
||||
<hibernate-mapping>
|
||||
<class name="security.SecUser" table="SCT_USER">
|
||||
<id name="id" type="java.lang.String">
|
||||
<column name="UUID" />
|
||||
<generator class="uuid.hex" />
|
||||
</id>
|
||||
<property name="createTime" type="timestamp">
|
||||
<column name="CREATETIME" />
|
||||
</property>
|
||||
<property generated="never" lazy="false" name="username"
|
||||
type="java.lang.String">
|
||||
<column length="64" name="USERNAME" />
|
||||
</property>
|
||||
<!--
|
||||
<property name="name" type="java.lang.String">
|
||||
<column name="NAME" />
|
||||
</property>
|
||||
<property generated="never" lazy="false" name="email"
|
||||
type="java.lang.String">
|
||||
<column length="32" name="EMAIL" />
|
||||
</property>
|
||||
-->
|
||||
<property generated="never" lazy="false" name="password"
|
||||
type="java.lang.String">
|
||||
<column length="256" name="PASSWORD" />
|
||||
</property>
|
||||
<property generated="never" lazy="false" name="partyId"
|
||||
type="java.lang.String">
|
||||
<column length="32" name="PARTY_UUID" />
|
||||
</property>
|
||||
<property generated="never" lazy="false" name="enabled" type="yes_no">
|
||||
<column name="ENABLED" />
|
||||
</property>
|
||||
<!--
|
||||
<property generated="never" lazy="false" name="isdel" type="yes_no">
|
||||
<column name="ISDEL" />
|
||||
</property>
|
||||
-->
|
||||
<set lazy="false" cascade="none" name="roles" outer-join="false"
|
||||
sort="unsorted" table="SCT_USER_ROLE">
|
||||
<key column="USER_UUID" />
|
||||
<many-to-many class="security.Role" column="ROLE_UUID"
|
||||
unique="false" />
|
||||
</set>
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
91
comm/Security/build/classes/spring/applicationContext-security.xml
Executable file
91
comm/Security/build/classes/spring/applicationContext-security.xml
Executable file
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.2.xsd">
|
||||
|
||||
<description>SpringSecurity</description>
|
||||
|
||||
<!-- If you enable single sign-on,To security:http plus entry-point-ref="casProcessingFilterEntryPoint" -->
|
||||
<security:http entry-point-ref="authenticationProcessingFilterEntryPoint">
|
||||
|
||||
<security:intercept-url pattern="/public/**"
|
||||
filters="none" />
|
||||
<security:intercept-url pattern="/api/**"
|
||||
filters="none" />
|
||||
<security:intercept-url pattern="/api/**"
|
||||
filters="none" />
|
||||
<security:logout invalidate-session="true"
|
||||
logout-success-url="/login.jsp" />
|
||||
<security:concurrent-session-control
|
||||
max-sessions="9999" expired-url="/default.jsp" />
|
||||
</security:http>
|
||||
<security:authentication-provider
|
||||
user-service-ref="userDetailsService">
|
||||
<security:password-encoder ref="passwordEncoder">
|
||||
|
||||
|
||||
</security:password-encoder>
|
||||
</security:authentication-provider>
|
||||
|
||||
|
||||
<bean id="authenticationProcessingFilterEntryPoint" class="security.filter.AuthenticationProcessingFilterEntryPoint">
|
||||
<property name="loginFormUrl" value="/login.jsp"></property>
|
||||
</bean>
|
||||
|
||||
<bean id="passwordEncoder"
|
||||
class="org.springframework.security.providers.encoding.Md5PasswordEncoder" />
|
||||
|
||||
|
||||
<bean id="secUserService" class="security.internal.SecUserServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
</bean>
|
||||
|
||||
<bean id="authenticationProcessingFilter"
|
||||
class="security.filter.AjaxableAuthenticationProcessingFilter">
|
||||
<security:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
|
||||
<property name="defaultTargetUrl" value="/user_login_success.jsp" />
|
||||
<property name="alwaysUseDefaultTargetUrl" value="true" />
|
||||
<property name="authenticationFailureUrl" value="/login.jsp"/>
|
||||
<property name="authenticationManager" ref="authenticationManager" />
|
||||
</bean>
|
||||
|
||||
<security:authentication-manager alias="authenticationManager"/>
|
||||
|
||||
<!-- 角色管理 -->
|
||||
<bean id="roleService" class="security.internal.RoleServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="securityAuthoritiesHolder" ref="securityAuthoritiesHolder" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="securityAuthoritiesHolder"
|
||||
class="security.internal.SecurityAuthoritiesHolderImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="filterSecurityInterceptor"
|
||||
class="org.springframework.security.intercept.web.FilterSecurityInterceptor"
|
||||
autowire="byType">
|
||||
<security:custom-filter before="FILTER_SECURITY_INTERCEPTOR" />
|
||||
<property name="objectDefinitionSource" ref="filterInvocationDefinitionSource" />
|
||||
</bean>
|
||||
<bean id="filterInvocationDefinitionSource"
|
||||
class="security.filter.UrlResourceFilterInvocationDefinitionSource">
|
||||
<property name="securityAuthoritiesHolder" ref="securityAuthoritiesHolder" />
|
||||
</bean>
|
||||
|
||||
<bean id="securityResourceProcessor"
|
||||
class="security.internal.SecurityResourceProcessorImpl">
|
||||
<property name="securityAuthoritiesHolder" ref="securityAuthoritiesHolder" />
|
||||
<property name="accessDecisionManager" ref="_accessManager" />
|
||||
</bean>
|
||||
|
||||
<bean id="resourceService"
|
||||
class="security.internal.ResourceServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
26
comm/Security/build/classes/struts2/normal.xml
Executable file
26
comm/Security/build/classes/struts2/normal.xml
Executable file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
<struts>
|
||||
<package name="normal" namespace="/normal" extends="root">
|
||||
<result-types>
|
||||
<result-type name="json" class="org.apache.struts2.json.JSONResult" />
|
||||
</result-types>
|
||||
<interceptors>
|
||||
<interceptor name="json"
|
||||
class="org.apache.struts2.json.JSONInterceptor" />
|
||||
</interceptors>
|
||||
|
||||
|
||||
<action name="defaultAction" class="project.party.action.DefaultAction">
|
||||
<result type="chain" name="index">
|
||||
<param name="actionName">indexAction</param>
|
||||
<param name="method">view</param>
|
||||
</result>
|
||||
</action>
|
||||
<action name="isLoginAction" class="security.web.IsLoginAction">
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
Reference in New Issue
Block a user