===============
User management
===============

.. contents::
   :local:
   :depth: 1

Adding a user
=============

New users can navigate in a browser to your local Repository
web page and sign themselves up for an account, or you can
add them using the command line::

  anaconda-server-create-user --username jsmith --password
  abc123DEF --email jsmith@acme.com

NOTE: Replace ``jsmith``, ``abc123DEF`` and ``jsmith@acme.com`` with
the username, password and email address of the new user.


Searching for users
===================

As of Anaconda Repository version 2.33.5, you can search for users by username
or email address. Open this URL in a browser::

    http://your.anaconda.server:port/admin/users

NOTE: Replace "your.anaconda.server:port" with the name or IP address and port
of your Anaconda server.


Promoting an existing user
==========================

As of Anaconda Repository version 2.28, administrators can use
the Administration Accounts page to promote users to staff or
superuser status.

Viewing rights of staff and superuser
-------------------------------------

The staff user and superuser can view the following sections of the
Administration page:

* Reports.

* User administration.

* License downloads.

* Trial licenses.

* Current LDAP configuration.

* Current server configuration.

* Downloads summary.

* Downloads from a specific address.

* Security feed and security feed details.

* Storage administration.

Privileges of staff and superuser
---------------------------------

The staff user and superuser have the following privileges:

* Create licenses.

* Download a CSV of the user database.

* Search for a package in the Administration panel.

* Resend confirmation emails to users.

* Resend password reset emails to users.

* Download a CSV with the users emails.

Additional rights of superuser
------------------------------

In addition to all of the above, a superuser can also view the
following on the Administration page:

* Plans.

* User details.

To promote an existing user to a staff user or superuser:

#. On the Administration page, in the left navigation pane, select Accounts.

#. Select the username you want to promote.

   Repository displays the user information page:

   .. figure:: /img/repo-admin-superuser-staff.png

      ..

   |

#. Click the Set Staff button to give the user staff privileges
   or click the Set Superuser button to give the user superuser
   privileges.

#. In the dialog box that appears, retype the user's name.

#. Click the Set button.


Resetting user passwords
========================

If a user forgets their password, you can request a reset link
to provide to the user.

To send emails, Repository must have the
:ref:`email settings <repo-admin-reference-emails>` configured.

#. Log into your Repository administrative account.

#. From the top **Tools** menu, select Admin.

#. From the left navigation pane, select Password Reset.

#. Enter the user's email address.

   The Web UI generates a password reset link.

#. Email the link to the user.

You can also reset passwords without sending emails::

  anaconda-server-admin reset-password jsmith

NOTE: Replace ``jsmith`` with the username whose password you want to
reset.


Resending welcome emails to new users
=====================================

To send emails, Repository must have the
:ref:`email settings <repo-admin-reference-emails>` configured.

If a user reports that they did not receive their welcome email after
registering on your local Repository web page, it may have been caught
in a spam filter.

Follow the above instructions for resetting user passwords.



Changing a user's storage size or changing their plan to free unlimited
=======================================================================

To change a user's storage size or plan:

#. Log into your Repository administrative account.

#. From the top **Tools** menu, select Admin.

#. From the left navigation pane, select Accounts.

#. Select the username of the user whose account you want to
   change.

#. To update the storage limits click Update Storage.

#. To set the user's plan to free and unlimited, click
   Set free unlimited plan.


Removing a user
===============

#. Log into your Repository administrative account.

#. From the top **Tools** menu, select Admin.

#. From the left navigation pane, select Accounts.

#. Select the username of the user you want to remove.

#. Click the Delete user button.

#. Optional: Use ``anaconda-server-admin clean-storage`` to remove files from that user's account.
