×
We value your feedback! Please click here to access our 2024 Client Survey.
The survey will remain open until November 1st. Your perspective will help guide our product/service planning and goals for the upcoming year and beyond!

make user a site admin via postgres SQL script?

LabKey Support Forum
make user a site admin via postgres SQL script? Ben Bimber  2010-08-18 07:56
Status: Closed
 
periodically we restore a dump of the production postgres db into both our development and stating machines. we have a SQL script that we run after this restore. It changes some basic settings like changing the site name, turning off SSL, deactivating users, etc. I modified it from a script Brian gave me.

We have a new person who is interested in doing development for one of our labs. Is there a mechanism using SQL such that we can make his user a site admin? the issue is that he's not a site admin on our production server, but he would want to be one on his development machine. I'd like to allow him to do the same postgres restore I'm using. using a SQL script to make that change would be a very convenient way to do it if possible.

thanks.
 
 
adam responded:  2010-08-18 09:20
The core.Members table determines group membership. If you insert a new row with GroupId=-1 (special id for site admin) and UserId=<this user's id> he will become a site admin. You can look up his id in the core.Users view, e.g., SELECT UserId FROM core.Users WHERE email='xxx@test.com'.

Adam
 
Ben Bimber responded:  2010-08-18 09:24
that'll work. thanks.