add-webspace-gid-and-create-webspace-main-user #94

Merged
hsh-michaelhoennig merged 6 commits from add-webspace-gid-and-create-webspace-main-user into master 2024-09-03 10:28:58 +02:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit 8ae270f887 - Show all commits

View File

@ -8,13 +8,15 @@ import java.util.regex.Pattern;
import static net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType.MANAGED_WEBSPACE;
import static net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType.UNIX_USER;
import static net.hostsharing.hsadminng.hs.validation.IntegerProperty.integerProperty;
class HsManagedWebspaceHostingAssetValidator extends HostingAssetEntityValidator {
public HsManagedWebspaceHostingAssetValidator() {
super(
MANAGED_WEBSPACE,
AlarmContact.isOptional(),
NO_EXTRA_PROPERTIES); // TODO.impl: groupid missing, should be equal to main user
integerProperty("groupid").readOnly()
);
}
@Override
@ -43,6 +45,7 @@ class HsManagedWebspaceHostingAssetValidator extends HostingAssetEntityValidator
.prepareForSave()
.saveUsing(emw::persist)
.validateContext();
webspaceAsset.getConfig().put("groupid", unixUserAsset.getConfig().get("userid"));
}
}
}

View File

@ -176,7 +176,9 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
"type": "MANAGED_WEBSPACE",
"identifier": "fir10",
"caption": "some separate ManagedWebspace HA",
"config": {}
"config": {
"groupid": 1000000
}
}
"""))
.header("Location", matchesRegex("http://localhost:[1-9][0-9]*/api/hs/hosting/assets/[^/]*"))