Skip to content
User Management

User Management

User Management stores the user accounts of your application. It covers the admin side (create, edit, disable and delete accounts, assign roles, groups and permissions) and the self-service side (registration, profile, contact data, password change and reset, mail verification, GDPR consents).

User accounts in the admin center

Enable

users := std.Must(cfg.UserManagement()) // application.UserManagement

You rarely call it yourself: Session Management is mandatory and enables User Management, which in turn enables Role, Permission, Group, Settings and Image Management.

application.UserManagement has two fields:

  • UseCases user.UseCases (package go.wdy.de/nago/application/user)
  • Pages uiuser.Pages with the paths Users, MyProfile, MyContact, ConfirmMail, ResetPassword and Register

Bootstrap admin

A fresh installation has no users. EnableBootstrapAdmin creates or reactivates the account admin@localhost with all nago.* permissions until the given time:

std.Must(std.Must(cfg.UserManagement()).UseCases.EnableBootstrapAdmin(time.Now().Add(time.Hour), "%6UbRsCuM8N$auy"))

Permissions of your own application are not included, assign them to the admin through a role.

Use cases

Use caseDescription
CreateCreates a user, also used by the self-registration.
FindByID, FindByMail, FindAll, FindAllIdentifiers, CountUsersLook up users.
DeleteDeletes an account and publishes user.Deleted, so that modules can remove data.
ChangeMyPassword, ChangeOtherPassword, ChangePasswordWithCodeChange the own password, another user’s password, or reset it with a code.
ResetPasswordRequestCode, RequiresPasswordChangeIssue a password reset code, check whether a password change is required.
ReadMyContact, UpdateMyContact, UpdateOtherContactRead and update contact data.
ChangeOtherEmailChanges the login mail of another user, the account becomes unverified.
UpdateOtherRoles, UpdateOtherGroups, UpdateOtherPermissions, AddUserToGroupAssign roles, groups and direct permissions.
ListRoles, ListGroups, ListGlobalPermissionsRead the roles, groups and global permissions of a user.
UpdateAccountStatusEnables or disables an account.
ConfirmMail, ResetVerificationCode, UpdateVerification, UpdateVerificationByMailMail verification.
AuthenticateByPasswordChecks mail and password.
SubjectFromUser, SysUser, GetAnonUserSubjects for a user ID, for the system (automations, migrations) and for anonymous users.
DisplayNameCached display name and avatar of a user.
EMailUsedReports whether a mail address is already taken.
ConsentApproves or revokes a GDPR consent.
ExportUsersExports users as CSV.
MergeSingleSignOnUserCreates or updates a user from a trusted SSO login.
EnableBootstrapAdminSee above.

AddResourcePermissions, RemoveResourcePermissions, ListResourcePermissions, GrantPermissions, ListGrantedPermissions and ListGrantedUsers are deprecated, use ReBAC instead.

The system publishes the events user.Created, user.Deleted, user.EMailChanged, user.ContactUpdated, user.ConsentChanged and user.MFACodeCreated.

Permissions

PermissionAllows to
nago.user.createcreate users
nago.user.find_by_idfind a user by ID
nago.user.find_by_mailfind a user by mail
nago.user.find_alllist all users
nago.user.change_other_passwordchange the password of other users
nago.user.deletedelete users
nago.user.update_other_contactchange the contact data of other users
nago.user.update_other_roleschange the roles of other users
nago.user.update_other_permissionschange the permissions of other users
nago.user.update_other_groupschange the groups of other users
nago.user.update_account_statusenable or disable accounts
nago.user.change_other_emailchange the mail address of other users
nago.user.export_usersexport users
nago.user.consent_otherset consents of other users

Settings

The global settings type user.Settings is edited in the admin center under Einstellungen and controls self-registration, self-service password reset, allowed mail domains, default and anonymous roles and groups, the GDPR consents shown at registration and in the profile, required contact fields and the single sign-on via the Nago Login Service. See Settings Management.

UI

PathPage
admin/accountsuser list for administrators
account/profileown profile
account/profile/contactown contact data
account/registerself-registration
account/confirmmail confirmation
account/password/resetpassword reset

The admin center shows the card Konten in the group Nutzerverwaltung to users with nago.user.find_all.

Related