Fix not clearing user's permissions, and issue with unsetting permissions

This commit is contained in:
Luck committed 2016-08-29 12:53:05 +01:00
1 parent f5995c0afa
commit d5bc1cdf5d
5 files changed
+29 -9

No files matched your search

@@ -61,10 +61,12 @@ public abstract class UserManager extends AbstractManager<UUID, User> {
@Override
public void copy(User from, User to) {
to.setNodes(from.getNodes());
to.setPrimaryGroup(from.getPrimaryGroup());
giveDefaultIfNeeded(to, true);
to.refreshPermissions();
if (from.getPrimaryGroup() != null) {
// This isn't just a black user. we shouldn't override in that case.
to.setNodes(from.getNodes());
to.setPrimaryGroup(from.getPrimaryGroup());
to.refreshPermissions();
}
}
/**