User Tools

Site Tools


en:user_advanced:gs3_user_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:user_advanced:gs3_user_management [2021/09/21 02:27] – [Command line editing] kjdonen:user_advanced:gs3_user_management [2023/03/13 01:46] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +
 +
 +
 ====== Greenstone 3 User Management ====== ====== Greenstone 3 User Management ======
  
Line 14: Line 17:
 Admin can register a new user by visiting the admin page: http://host:port/greenstone3/library/admin/ListUsers, then clicking the 'Add A New User' button. Admin can register a new user by visiting the admin page: http://host:port/greenstone3/library/admin/ListUsers, then clicking the 'Add A New User' button.
  
-===== Command line editing =====+===== User Groups =====
  
-**ant config-admin** - reset the admin password+Groups are used to determine what functionality a user is provided. Multiple groups are specified in a comma-separated list. 
 + 
 +**administrator** - can do user management\\ 
 +**all-collections-editor** - can edit any collection (through web editing or through remote GLI)\\ 
 +**personal-collections-editor** - the user can create their own collections and edit them\\ 
 +**<collname>-collection-editor** - the user can edit the <collname> collection\\ 
 + 
 +Bespoke groups can be added then used in security elements in individual collections, thereby restricting access to only a subset of users. See the [[en:user_advanced:security| Security in Greenstone Collections]] page. 
 +===== Command line editing of users ===== 
 + 
 +**ant config-admin** - reset the admin password\\
 **ant config-user** - add or edit users. This requires you to provide all user fields: username, password, groups, status, comment, email. They can be left blank, but it will override any previous values in the db. **ant config-user** - add or edit users. This requires you to provide all user fields: username, password, groups, status, comment, email. They can be left blank, but it will override any previous values in the db.
  
-Or you can directly use the java class. +Or you can directly use the java class.\\ 
-Make sure you have 'source gs3-setup.sh(linux/Mac) or 'gs3-setup.bat(windows) +Make sure you have set up the Greenstone environment by running **source gs3-setup.sh** (linux/Mac) or **gs3-setup.bat** (windows). Also, start the derby server if its not already running:  **ant start-derby**if Greenstone is running, then the derby server will be running.
-**ant start-derby** (if greenstone or the derby server is not already running)+
  
 <code> <code>
 java org.greenstone.gsdl3.util.ModifyUsersDB  java org.greenstone.gsdl3.util.ModifyUsersDB 
-Usage: java org.greenstone.gsdl3.ModifyUsersDB <full_path_of_the_usersDB> <username|ALL> [-noAdd] [password=pwd] [groups=grp] [addgroups=grp] [accounstatus=status] [comment=cmt] [email=address]+Usage: java org.greenstone.gsdl3.ModifyUsersDB <full_path_of_the_usersDB> <username|ALL> [-noAdd]  
 +[password=pwd] [groups=grp] [addgroups=grp] [accounstatus=status] [comment=cmt] [email=address]
 </code> </code>
  
 (Options valid for releases from September 2021) (Options valid for releases from September 2021)
 +
 Eg: To add a new user Eg: To add a new user
-java org.greenstone.gsdl3.ModifyUsersDB <path-to-greenstone3>/web/etc/usersDB kath password=changeme groups=student+<code>java org.greenstone.gsdl3.ModifyUsersDB <path-to-greenstone3>/web/etc/usersDB kath password=changeme groups=student</code>
  
-The 'groupsoption will set the group field to the specified value. +The **groups** option will set the group field to the specified value.\\ 
-The 'addgroupsoption will add the specified groups to whatever groups exist already (if editing an existing user)+The **addgroups** option will add the specified groups to whatever groups exist already (if editing an existing user)
  
-Using username 'ALLwill perform the selected changes on all users.+Using username **ALL** will perform the selected changes on all users.\\
 For example, to add the 'student' group to all users, run For example, to add the 'student' group to all users, run
  
-java org.greenstone.gsdl3.ModifyUsersDB <path-to-greenstone3>/web/etc/usersDB ALL  addgroups=student+<code>java org.greenstone.gsdl3.ModifyUsersDB <path-to-greenstone3>/web/etc/usersDB ALL  addgroups=student</code>
  
-TODO: +The **-noAdd** option will **not** create new user if the specified username does not exist. 
-  Registering as a user + 
-  * User groups +==== Viewing and Editing the database via a text file ==== 
-  Editing users+ 
 +There are 2 java programs which help you view and edit the database: usersDB2txt and txt2usersDB 
 +As above, you must set up the greenstone environment, and make sure the derby server is running. 
 + 
 +They are run like: 
 +<code> 
 +java org.greenstone.gsdl3.util.usersDB2txt <path-to-gs3>/web/etc/usersDB >& usersDB.txt 
 + 
 +... edit the file if necessary, then regenerate the DB: 
 + 
 +java org.greenstone.gsdl3.util.txt2usersDB usersDB.txt <path-to-gs3>/web/etc/usersDB [-append] 
 +</code> 
 +The **-append** option means append the contents of the file into the DB. Without it, the current contents will be deleted.
  
 ==== Setting up the Recaptcha test for User Registration ==== ==== Setting up the Recaptcha test for User Registration ====
Line 120: Line 146:
 </init-param> </init-param>
 </code> </code>
- 
  
en/user_advanced/gs3_user_management.1632191241.txt.gz · Last modified: 2021/09/21 02:27 by kjdon