public final void setPerms(ChunkyObject object, HashMap<PermissionFlag, Boolean> flags) {
        if (flags == null) {
            ChunkyManager.getPermissions(object, this).clearFlags();
            DatabaseManager.getDatabase().removePermissions(object, this);
            return;
        }

        PermissionRelationship perms = ChunkyManager.getPermissions(object, this);
        for (Map.Entry<PermissionFlag, Boolean> flag : flags.entrySet()) {
            setPerm(object, flag.getKey(), flag.getValue());
        }
        DatabaseManager.getDatabase().updatePermissions(this, object, perms);
    }