Fix permissions inheritance issue on newly created server groups

This commit is contained in:
Colin McDonald 2016-07-13 23:14:42 -04:00
parent 6c16fa7b18
commit 3a213de233

View File

@ -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<String, Boolean> calculatePermissions(Rank rank) {
return PermissionUtils.mergeUpTo(permissions, rank);
if (permissions == null) {
return ImmutableMap.of();
} else {
return PermissionUtils.mergeUpTo(permissions, rank);
}
}
public void insert(SingleResultCallback<Void> callback) {