Node privacy by-role updates

I recently had to do an ACL update of a large portion of my content, ACLs which are managed by the Node privacy by-role module. To avoid having to do this manually, and I couldn't find any "GUI" to let me do it, I decided to try it from command line. So, not being a mySQL expert, I still managed to do this from within the mysql client. In my case, I needed to add read permissions to the group of authenticated users, for all content that was viewable by the anonymous user. The SQL code is as follow:

CREATE TEMPORARY TABLE foo AS SELECT nid FROM node_privacy_byrole
        WHERE gid=1 AND grant_view=1 AND realm="node_privacy_byrole_role";

UPDATE node_privacy_byrole,foo SET node_privacy_byrole.grant_view=1
        WHERE node_privacy_byrole.nid=foo.nid AND node_privacy_byrole.gid=2;