|
@@ -2,13 +2,13 @@ package sample.dms;
|
|
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
-import org.acegisecurity.Authentication;
|
|
|
-import org.acegisecurity.GrantedAuthority;
|
|
|
-import org.acegisecurity.GrantedAuthorityImpl;
|
|
|
-import org.acegisecurity.context.SecurityContextHolder;
|
|
|
-import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.security.Authentication;
|
|
|
+import org.springframework.security.GrantedAuthority;
|
|
|
+import org.springframework.security.GrantedAuthorityImpl;
|
|
|
+import org.springframework.security.context.SecurityContextHolder;
|
|
|
+import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
|
|
|
import org.springframework.transaction.PlatformTransactionManager;
|
|
|
import org.springframework.transaction.TransactionStatus;
|
|
|
import org.springframework.transaction.support.TransactionCallback;
|
|
@@ -57,15 +57,15 @@ public class DataSourcePopulator implements InitializingBean {
|
|
|
template.execute("CREATE TABLE FILE(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY, FILE_NAME VARCHAR_IGNORECASE(50) NOT NULL, CONTENT VARCHAR_IGNORECASE(1024), PARENT_DIRECTORY_ID BIGINT)");
|
|
|
|
|
|
// Populate the authentication and role tables
|
|
|
- template.execute("INSERT INTO USERS VALUES('marissa','a564de63c2d0da68cf47586ee05984d7',TRUE);");
|
|
|
+ template.execute("INSERT INTO USERS VALUES('rod','a564de63c2d0da68cf47586ee05984d7',TRUE);");
|
|
|
template.execute("INSERT INTO USERS VALUES('dianne','65d15fe9156f9c4bbffd98085992a44e',TRUE);");
|
|
|
template.execute("INSERT INTO USERS VALUES('scott','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
|
|
|
template.execute("INSERT INTO USERS VALUES('peter','22b5c9accc6e1ba628cedc63a72d57f8',FALSE);");
|
|
|
template.execute("INSERT INTO USERS VALUES('bill','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
|
|
|
template.execute("INSERT INTO USERS VALUES('bob','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
|
|
|
template.execute("INSERT INTO USERS VALUES('jane','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
|
|
|
- template.execute("INSERT INTO AUTHORITIES VALUES('marissa','ROLE_USER');");
|
|
|
- template.execute("INSERT INTO AUTHORITIES VALUES('marissa','ROLE_SUPERVISOR');");
|
|
|
+ template.execute("INSERT INTO AUTHORITIES VALUES('rod','ROLE_USER');");
|
|
|
+ template.execute("INSERT INTO AUTHORITIES VALUES('rod','ROLE_SUPERVISOR');");
|
|
|
template.execute("INSERT INTO AUTHORITIES VALUES('dianne','ROLE_USER');");
|
|
|
template.execute("INSERT INTO AUTHORITIES VALUES('scott','ROLE_USER');");
|
|
|
template.execute("INSERT INTO AUTHORITIES VALUES('peter','ROLE_USER');");
|
|
@@ -74,7 +74,7 @@ public class DataSourcePopulator implements InitializingBean {
|
|
|
template.execute("INSERT INTO AUTHORITIES VALUES('jane','ROLE_USER');");
|
|
|
|
|
|
// Now create an ACL entry for the root directory
|
|
|
- SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken("marissa", "ignored", new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_IGNORED")}));
|
|
|
+ SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken("rod", "ignored", new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_IGNORED")}));
|
|
|
tt.execute(new TransactionCallback() {
|
|
|
public Object doInTransaction(TransactionStatus arg0) {
|
|
|
addPermission(documentDao, Directory.ROOT_DIRECTORY, "ROLE_USER", LEVEL_GRANT_WRITE);
|
|
@@ -83,7 +83,7 @@ public class DataSourcePopulator implements InitializingBean {
|
|
|
});
|
|
|
|
|
|
// Now go off and create some directories and files for our users
|
|
|
- createSampleData("marissa", "koala");
|
|
|
+ createSampleData("rod", "koala");
|
|
|
createSampleData("dianne", "emu");
|
|
|
createSampleData("scott", "wombat");
|
|
|
}
|