@Override public final boolean inGroup(final String group) { if (groupCache.isPrepared()) { return groupCache.isGroupPresent(group); } else { return user.inGroup(group); } }
@Override public final boolean prepare() { if (groupCache.isPrepared()) { groupCache.clear(); } groupCache.addPresentGroups(user.getOwnParentIdentifiers()); // TODO: VERIFY SANITY. return true; }
@Override public final void removeGroup(final String group) { if (groupCache.isPrepared()) { groupCache.removeGroup(group); } else { user.removeGroup(group); if (user.isVirtual()) { perms.changed.add(playerName); } } }
@Override public final boolean applyChanges() { if (groupCache.hasChangesPending()) { // TODO: Do JITs contain the necessary kind of magic by now? for (final String groupName : groupCache.getGroupsToRemove()) { user.removeGroup(groupName); } for (final String groupName : groupCache.getGroupsToAdd()) { user.addGroup(groupName); } } groupCache.clear(); if (user.isVirtual()) { perms.changed.add(playerName); } return true; }
@Override public final void discardChanges() { groupCache.clear(); }