xTuple.com xTupleU Blog & News Customer Support

User to User Privilege and Role Copier

Hi Folks,

I wrote this utility to make my life easier during implementations and after a few requests I decided to clean and package it up. This is compatible with PostBooks/xTuple 3.8.0 and above, apply using updater 2.2.4 or newer.

After installation you will find a new entry under System > Utilities called Copy Privileges, this requires the MaintainUsers privilege to use.

Privilege Copier Screenshot

You will need to select the source user and the destination user, and you have the option to copy privileges and roles individually or at the same time. I definitely recommend clearing the destination users privileges and roles before you copy so check those boxes as well, and then click copy. Once finished you will be presented with a screen display the number of privileges and roles copied.

Please note that this is a package I am releasing on my own and is in no way supported by the xTuple support staff. If you run in to issues, please post here and I will do my best to help you out.



*EDIT* version 0.1.1 attached, which includes fix for issue Alfredo pointed out


Hi David-

Wow. What a great little package. I woke up this morning thinking about how I could maintain all my users and was thinking about writing an SQL snippet and arm-stronging it with PGAdmin.

Just used it in 3.8.4 and it worked great.


Thanks so much for sharing,


Thanks. Can't live without the utility.


This looks like you left some debug code in hardwiring to the admin account.

    // we need to check and make sure the source user doesn't have orphaned privileges that will fail to insert
    var orphanPrivs = toolbox.executeQuery("select usrpriv_id from usrpriv left join priv on usrpriv_priv_id = priv_id "
                       +" where usrpriv_username = 'admin' and coalesce(priv_name, '') = '';", params);


Bumping this thread to attach the package to it again, as I no longer see it on the original post.

privcopier.0.1.1.gz (3.5 KB)