Skip to main content
Version: 4.x

Accounts

Overview

Accounts log in to the platform and receive their permissions from one or more roles; administrator accounts are not restricted by permissions.

Accounts

Fields

  • Login name: the user name, globally unique.
  • Name: the display name shown in the header.
  • Password: at least 8 characters with digits, lowercase and uppercase letters; only set when creating the account.
  • Roles: one or more roles; permissions of all roles are combined.
  • WeChat token: used for WeChat alerts and login MFA codes, see WeChat token; users can also set it in their profile.

Operations

  • Edit: change name, roles and WeChat token; Reset password sets a new password.
  • Disable / Enable: accounts are disabled after more than 3 consecutive failed logins and can be re-enabled here; LDAP accounts cannot be deleted, disable them instead.
  • Delete: remove the account; data created by the account is kept.
  • LDAP users can be imported in bulk under Settings / LDAP Settings, see System settings.

Command line

Besides the page, Spug provides the manage.py user command for administrator accounts.

Create an account

cd spug/spug_api
source venv/bin/activate
python manage.py user add -u admin -p 123 -n "John Doe" -s

With the Docker install:

docker exec spug python3 /data/spug/spug_api/manage.py user add -u admin -p 123 -n "John Doe" -s

This creates an administrator with login name admin, password 123 and display name John Doe. The trailing -s flag makes the account an administrator with unrestricted access to every module.

Reset a password

cd spug/spug_api
source venv/bin/activate
python manage.py user reset -u admin -p abc

With the Docker install:

docker exec spug python3 /data/spug/spug_api/manage.py user reset -u admin -p abc

This sets the password of admin to abc.

Enable an account

Accounts are disabled after more than 3 consecutive failed logins. Regular accounts can be enabled on the System / Accounts page; administrator accounts need the command below:

cd spug/spug_api
source venv/bin/activate
python manage.py user enable -u admin

With the Docker install:

docker exec spug python3 /data/spug/spug_api/manage.py user enable -u admin