@Override
    public boolean equals(Object obj) {
        if ((obj == null) || (obj.getClass() != this.getClass())) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        Permissions test = (Permissions) obj;
        // id seems to be photo id
        if (id == null ? test.id == null : id.equals(test.id)) {
            return publicFlag == test.publicFlag && friendFlag == test.friendFlag && familyFlag == test.familyFlag && comment == test.comment
                    && addmeta == test.addmeta;
        }
        return false;
    }