From f65fe27c53952ed9720a6e90d6801c351990b0ca Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Sun, 4 Mar 2018 18:53:45 -0800 Subject: [PATCH] Shallow copy of the map. This is why it was setting one perm for all roles and relations. --- .../factions/zcore/persist/MemoryFaction.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java index 5ae012b3..24c679b7 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java @@ -397,10 +397,6 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { return Access.UNDEFINED; } - public Map> getAccessMap() { - return Collections.unmodifiableMap(permissions); - } - public void setPermission(Permissable permissable, PermissableAction permissableAction, Access access) { Map accessMap = permissions.get(permissable); if (accessMap == null) { @@ -423,13 +419,13 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { // Put the map in there for each relation. for (Relation relation : Relation.values()) { - permissions.put(relation, freshMap); + permissions.put(relation, new HashMap<>(freshMap)); } // And each role. for (Role role : Role.values()) { if (role != Role.ADMIN) { - permissions.put(role, freshMap); + permissions.put(role, new HashMap<>(freshMap)); } } }