Add command to register existing user as service user

Before installing the serviceuser plugin technical users might already
exist, e.g. in LDAP or in Gerrit itself. It might be desirable to
register those users as service users to avoid having multiple account
types for the same purpose.

This change adds a SSH command that allows to register an existing
user as a serviceuser by adding the serviceuser specific data to the
serviceuser.db file in the All-Projects repository.

To be able to execute this command, the caller has to either be an
administrator or be the user that should be registered as a service
user and have the 'create serviceuser' capability. This was done to
prevent users from registering other users, which they don't own, as
serviceusers, which would allow them to basically get all access rights
the serviceuser has.

The command allows for setting the creator manually and to also set
the owner group.

Change-Id: I447bc702565d2836ef12072fd5656be343428cf3
4 files changed