You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hise-commits@incubator.apache.org by rr...@apache.org on 2010/09/23 15:39:28 UTC

svn commit: r1000501 - in /incubator/hise/trunk: hise-fe/pom.xml hise-fe/src/main/resources/security.xml hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java hise-web/pom.xml hise-web/src/main/resources/hise-ds.xml

Author: rr
Date: Thu Sep 23 15:39:27 2010
New Revision: 1000501

URL: http://svn.apache.org/viewvc?rev=1000501&view=rev
Log:
HISE-92: Hise should use shared security entities between hise-fe and hise-web components (Thanks to Akhilesh Singh)

Modified:
    incubator/hise/trunk/hise-fe/pom.xml
    incubator/hise/trunk/hise-fe/src/main/resources/security.xml
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java
    incubator/hise/trunk/hise-web/pom.xml
    incubator/hise/trunk/hise-web/src/main/resources/hise-ds.xml

Modified: incubator/hise/trunk/hise-fe/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/pom.xml?rev=1000501&r1=1000500&r2=1000501&view=diff
==============================================================================
--- incubator/hise/trunk/hise-fe/pom.xml (original)
+++ incubator/hise/trunk/hise-fe/pom.xml Thu Sep 23 15:39:27 2010
@@ -45,6 +45,13 @@
             <artifactId>hise-ws-client</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- Added by Akhilesh for spring security to share user data with hise-web -->
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <version>1.2.143</version>
+            <scope>runtime</scope>
+        </dependency>
         
         <!-- GWT deps -->
 		<dependency>

Modified: incubator/hise/trunk/hise-fe/src/main/resources/security.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/resources/security.xml?rev=1000501&r1=1000500&r2=1000501&view=diff
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/resources/security.xml (original)
+++ incubator/hise/trunk/hise-fe/src/main/resources/security.xml Thu Sep 23 15:39:27 2010
@@ -8,13 +8,30 @@
 	<authentication-manager alias="springSecurityManager"/>
 	
 	<authentication-provider>
+<!--
 	    <user-service>
 	        <user name="user1" password="pass1" authorities="ROLE_USER" />
             <user name="someUser" password="someUser" authorities="ROLE_USER" />
 	        <user name="user2" password="pass2" authorities="ROLE_USER" />
 	        <user name="admin" password="admin" authorities="ROLE_USER" />
 	    </user-service>
+-->
+          <jdbc-user-service data-source-ref="dataSourceSecurity"
+      	users-by-username-query="SELECT u.name, u.userPassword, u.enabled AS enabled FROM hise_entity u where u.name=?"
+      	authorities-by-username-query="SELECT u.name,u.role from hise_entity u where u.name=?"/>
+
 	</authentication-provider>
+
+    <beans:bean id="dataSourceSecurity" class="org.springframework.jdbc.datasource.SingleConnectionDataSource" lazy-init="true">
+        <beans:property name="driverClassName" value="org.h2.Driver" />
+        <beans:property name="url" value="jdbc:h2:tcp://localhost/~/test"/>
+        <beans:property name="username" value="sa" />
+        <beans:property name="password">
+            <beans:value></beans:value>
+        </beans:property>
+        <beans:property name="autoCommit" value="false" />
+        <beans:property name="suppressClose" value="true" />
+    </beans:bean>
 	    
     <http>
         <intercept-url pattern="/login.jsp*" filters="none" />

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java?rev=1000501&r1=1000500&r2=1000501&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java Thu Sep 23 15:39:27 2010
@@ -33,7 +33,7 @@ import javax.persistence.Table;
 
 /**
  * Task Assignee - member of generic human role.
- * @author Witek Wołejszo
+ * @author Witek Wo?ejszo
  */
 @Entity
 @Table(name = "HISE_ENTITY")
@@ -51,6 +51,8 @@ public class OrgEntity extends JpaBase {
     private TaskOrgEntity.OrgEntityType type;
 
     private String userPassword;
+    private String role;
+    private boolean enabled;
     
     @OneToMany(cascade = {CascadeType.ALL})
     @JoinTable(name="HISE_USER_GROUPS")
@@ -90,6 +92,22 @@ public class OrgEntity extends JpaBase {
         this.type = type;
     }
 
+    public boolean isEnabled() {
+        return enabled;
+   }
+   
+    public void setEnabled(boolean enabled) {
+         this.enabled =  enabled;
+    }
+
+    public String getRole() {
+         return role;
+    }
+    
+    public void setRole(String role) {
+       this.role=role;
+   }
+
     @Override
     public Object[] getKeys() {
         return new Object[] {name} ;

Modified: incubator/hise/trunk/hise-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-web/pom.xml?rev=1000501&r1=1000500&r2=1000501&view=diff
==============================================================================
--- incubator/hise/trunk/hise-web/pom.xml (original)
+++ incubator/hise/trunk/hise-web/pom.xml Thu Sep 23 15:39:27 2010
@@ -23,7 +23,7 @@
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>1.1.108</version>
+            <version>1.2.143</version>
             <scope>runtime</scope>
         </dependency>
         <!--

Modified: incubator/hise/trunk/hise-web/src/main/resources/hise-ds.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-web/src/main/resources/hise-ds.xml?rev=1000501&r1=1000500&r2=1000501&view=diff
==============================================================================
--- incubator/hise/trunk/hise-web/src/main/resources/hise-ds.xml (original)
+++ incubator/hise/trunk/hise-web/src/main/resources/hise-ds.xml Thu Sep 23 15:39:27 2010
@@ -65,7 +65,7 @@
 
     <bean id="dataSource" class="org.springframework.jdbc.datasource.SingleConnectionDataSource" lazy-init="true">
         <property name="driverClassName" value="org.h2.Driver" />
-        <property name="url" value="jdbc:h2:file:hise-h2-db;DB_CLOSE_ON_EXIT=false"/>
+        <property name="url" value="jdbc:h2:tcp://localhost/~/test"/>
         <property name="username" value="sa" />
         <property name="password">
             <value></value>