From 3a213de2331b3eec1d5aa680f07e0701b97fcac1 Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Wed, 13 Jul 2016 23:14:42 -0400 Subject: [PATCH] Fix permissions inheritance issue on newly created server groups --- src/main/java/net/frozenorb/apiv3/model/ServerGroup.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/frozenorb/apiv3/model/ServerGroup.java b/src/main/java/net/frozenorb/apiv3/model/ServerGroup.java index d958594..0271a60 100644 --- a/src/main/java/net/frozenorb/apiv3/model/ServerGroup.java +++ b/src/main/java/net/frozenorb/apiv3/model/ServerGroup.java @@ -1,6 +1,7 @@ package net.frozenorb.apiv3.model; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.mongodb.async.SingleResultCallback; import com.mongodb.async.client.MongoCollection; import fr.javatic.mongo.jacksonCodec.Entity; @@ -73,7 +74,11 @@ public final class ServerGroup { } public Map calculatePermissions(Rank rank) { - return PermissionUtils.mergeUpTo(permissions, rank); + if (permissions == null) { + return ImmutableMap.of(); + } else { + return PermissionUtils.mergeUpTo(permissions, rank); + } } public void insert(SingleResultCallback callback) {