Fix permissions inheritance issue on newly created server groups
This commit is contained in:
parent
6c16fa7b18
commit
3a213de233
@ -1,6 +1,7 @@
|
|||||||
package net.frozenorb.apiv3.model;
|
package net.frozenorb.apiv3.model;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.mongodb.async.SingleResultCallback;
|
import com.mongodb.async.SingleResultCallback;
|
||||||
import com.mongodb.async.client.MongoCollection;
|
import com.mongodb.async.client.MongoCollection;
|
||||||
import fr.javatic.mongo.jacksonCodec.Entity;
|
import fr.javatic.mongo.jacksonCodec.Entity;
|
||||||
@ -73,8 +74,12 @@ public final class ServerGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Boolean> calculatePermissions(Rank rank) {
|
public Map<String, Boolean> calculatePermissions(Rank rank) {
|
||||||
|
if (permissions == null) {
|
||||||
|
return ImmutableMap.of();
|
||||||
|
} else {
|
||||||
return PermissionUtils.mergeUpTo(permissions, rank);
|
return PermissionUtils.mergeUpTo(permissions, rank);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void insert(SingleResultCallback<Void> callback) {
|
public void insert(SingleResultCallback<Void> callback) {
|
||||||
serverGroupCache.add(this);
|
serverGroupCache.add(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user