wiki:sysadminAddingUsersToGroups

Adding users to groups

Right now, we have to do this directly in the database.

Start by connecting to the database.

Retrieve the user ID from the actor.usr table. In the following example, we get the ID for someone with the first name "Dan" and the last name "Scott". We use the ILIKE operator because names have been entered with all kinds of uppercase / lowercase mixes.

conifer=# SELECT id, family_name, first_given_name, home_ou 
FROM actor.usr 
WHERE family_name ILIKE 'Scott' AND first_given_name ILIKE 'Dan%';

This query returns something like:

  id   | family_name  | first_given_name |  home_ou 
-------+--------------+------------------+----------
 666   | Scott        | Dan              + 103
(1 row)

Okay, that's the user we want. Now we'll grant the user work permissions at the pertinent library; in this case, the library with id 107.

conifer=# INSERT INTO permission.usr_work_ou_map (usr, work_ou) VALUES (666, 107);
INSERT 0 1

And then we add this user to the Super circulator permission group (118):

conifer=# insert into permission.usr_grp_map (usr, grp) values (666, 118);
INSERT 0 1
Last modified 9 years ago Last modified on Jun 4, 2013, 10:39:58 AM

Attachments (1)

Download all attachments as: .zip