From 3419f107df5b1f5c9e389dcf5b27e575a86cf7cf Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Mon, 21 Jan 2013 13:41:01 +0100 Subject: [PATCH] fix error in adding new object with hostmaster privileges --- hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java | 1 + hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java | 1 + hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java | 1 + hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java | 1 + hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java | 1 + 5 files changed, 5 insertions(+) diff --git a/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java index eb6c16f..f111ad5 100644 --- a/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java @@ -54,6 +54,7 @@ public class MySqlDatabaseModuleImpl extends AbstractModuleImpl { if (!pac.getName().equals(pacPrefix)) { throw new HSAdminException("wrong database owner"); } + database.setPac(pac); return super.add(newEntity); } diff --git a/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java index cdee8bd..8fb0488 100644 --- a/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java @@ -35,6 +35,7 @@ public class MySqlUserModuleImpl extends AbstractModuleImpl { if (pac == null || !pac.isReadAllowedFor(loginUser)) { throw new AuthorisationException(loginUser, "add", newEntity); } + user.setPac(pac); return super.add(newEntity); } diff --git a/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java index 9045678..841f090 100644 --- a/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java @@ -52,6 +52,7 @@ public class PgSqlDatabaseModuleImpl extends AbstractModuleImpl { if (!pac.getName().equals(pacPrefix)) { throw new HSAdminException("wrong database owner"); } + database.setPac(pac); return super.add(newEntity); } diff --git a/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java index 24ee175..c0c9835 100644 --- a/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java @@ -30,6 +30,7 @@ public class PgSqlUserModuleImpl extends AbstractModuleImpl { if (pac == null || !pac.isReadAllowedFor(loginUser)) { throw new AuthorisationException(loginUser, "add", newEntity); } + user.setPac(pac); return super.add(newEntity); } diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java b/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java index 5d21211..c7a1b4e 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java @@ -44,6 +44,7 @@ public class EMailAliasModuleImpl extends AbstractModuleImpl { if (!name.startsWith(pac.getName())) { throw new AuthorisationException(loginUser, "add", newEntity); } + alias.setPac(pac); return super.add(newEntity); }