Skip to content

Commit

Permalink
Allow users to modify existing homes when over homes limit (#3776)
Browse files Browse the repository at this point in the history
Fixes #3761
  • Loading branch information
JRoy committed Nov 15, 2020
1 parent 1fed7a9 commit 3ba675a
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -71,10 +71,10 @@ public void run(final Server server, final User user, final String commandLabel,
private boolean checkHomeLimit(final User user, final User usersHome, final String name) throws Exception {
if (!user.isAuthorized("essentials.sethome.multiple.unlimited")) {
final int limit = ess.getSettings().getHomeLimit(user);
if (usersHome.getHomes().size() == limit && usersHome.getHomes().contains(name)) {
return false;
}
if (usersHome.getHomes().size() >= limit) {
if (usersHome.getHomes().contains(name)) {
return false;
}
throw new Exception(tl("maxHomes", ess.getSettings().getHomeLimit(user)));
}
return limit == 1;
Expand Down

0 comments on commit 3ba675a

Please sign in to comment.