Vault only save if a change was made

This commit is contained in:
Luck 2016-12-27 12:24:19 +00:00
parent 6874cfd5b1
commit 2d5975d6e3
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -106,10 +106,9 @@ public class VaultPermissionHook extends Permission {
} else { } else {
holder.setPermission(permission, true, server); holder.setPermission(permission, true, server);
} }
} catch (ObjectAlreadyHasException ignored) {
}
save(holder); save(holder);
} catch (ObjectAlreadyHasException ignored) {}
} }
/** /**
@ -126,10 +125,9 @@ public class VaultPermissionHook extends Permission {
} else { } else {
holder.unsetPermission(permission, server); holder.unsetPermission(permission, server);
} }
} catch (ObjectLacksException ignored) {
}
save(holder); save(holder);
} catch (ObjectLacksException ignored) {}
} }
/** /**
@ -269,9 +267,9 @@ public class VaultPermissionHook extends Permission {
} else { } else {
user.setInheritGroup(group, server); user.setInheritGroup(group, server);
} }
} catch (ObjectAlreadyHasException ignored) {
}
save(user); save(user);
} catch (ObjectAlreadyHasException ignored) {}
}); });
return true; return true;
} }
@ -294,9 +292,9 @@ public class VaultPermissionHook extends Permission {
} else { } else {
user.unsetInheritGroup(group, server); user.unsetInheritGroup(group, server);
} }
} catch (ObjectLacksException ignored) {
}
save(user); save(user);
} catch (ObjectLacksException ignored) {}
}); });
return true; return true;
} }