Creating a system user

System users for Spordle staff cannot be created from the app and need to be created through the database.

  1. Create the participant in the Spordle tenant. Note the participant ID, assuming it’s 123 for the examples

  2. Add the system permission. Assuming system id is 1 for the example, it varies between staging/prod.

    INSERT INTO accountpermission (principaltype, principalid, roleid) VALUES ('Participant', '123', 1)
  3. Invite the account through the app. Need to wait for the account to be created before you can proceed as you need the account ID for the identities. Assuming it’s 456 for this example.

  4. Add AccountIdentities for the other tenants. Note Spordle is excluded in the query below because an identity for it already exists from creating the account.

    INSERT INTO accountidentity (participantid, accountid, isprimary, tenantid) SELECT 123, 456, false, id FROM tenant WHERE name != 'Spordle'

If admin permissions were already created, you can follow the above, but clean up the other participants and identities first. You can reuse the existing account.