示例#1
0
 @Override
 public final boolean inGroup(final String group) {
   if (groupCache.isPrepared()) {
     return groupCache.isGroupPresent(group);
   } else {
     return user.inGroup(group);
   }
 }
示例#2
0
 @Override
 public final boolean prepare() {
   if (groupCache.isPrepared()) {
     groupCache.clear();
   }
   groupCache.addPresentGroups(user.getOwnParentIdentifiers()); // TODO: VERIFY SANITY.
   return true;
 }
示例#3
0
 @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);
     }
   }
 }
示例#4
0
 @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;
 }
示例#5
0
 @Override
 public final void discardChanges() {
   groupCache.clear();
 }