Class AdministratorAccess

java.lang.Object
com.iizix.server.user.AdministratorAccess

public final class AdministratorAccess extends Object
The rule of who administers the server: a user in an ENABLED group named GroupInfo.ADMIN_GROUP_NAME. A group flagged "all apps" grants access to applications, not administration, and admits nobody here; a disabled group grants nothing; a disabled user is refused (the owner's ruling SA-1 of CC-FIX-SERVERADMIN, 2026-09-27).

ServerAdmin asks at every sign-in and at every entry of one of its pages (com.iizix.serveradmin.AdminSessionGate; the owner's ruling SA-1 of CC-SERVERADMIN-SIGNIN, 2026-10-02). The groups are read from the database on every call, and sessionRefusal(IAuthenticatedUser) reads the user again too: a user disabled or taken out of the group while signed in, and a group disabled by SQL, count at the next page.

Author:
Christopher Mindus
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    What became of a real e-mail address an administrator entered (setRealEmail(IAuthenticatedUser, String)).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The domain of the e-mail address the server's database gives its administrator (createBaseTables.sql: default@iizi.server.administrator).
    static final Set<String>
    The application IDs of ServerAdmin (decision B5D-D-b): com.iizix.serveradmin, the ID of its module (iiziServer\apps\ServerAdmin\.iiziModuleProject) and of every launcher since CC-FIX-SERVERADMIN-APPID (iiziServer\bin\iiziServer.bat, .sh, BuildUtil\LinuxCommands\launchServer.sh), and com.iizix.server.admin, the ID the shipped launchers gave it up to r20656, which a server configured by hand may still name.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Decides whether a database user must enter a real e-mail address before administering the server (the owner's ruling ADM-D-1, 2026-10-18): a member of an enabled administrators group whose address is in the seeded domain (isSeededEmail(String)) - the account the server was installed with - or who has NO address at all (hasNoEmail(String); the owner's ruling UX-D-6 of CC-FIX-SIGNIN-V5-UX, 2026-10-18 23:12: a forgotten password of such an account cannot be reset either).
    static boolean
    Checks if an account has no e-mail address at all: null or blank (UX-D-6).
    static boolean
    Checks if an address an administrator enters is a real one: well formed (EmailAddressForm) and not in the seeded domain (isSeededEmail(String)).
    static boolean
    Checks if an e-mail address is in the domain the database was created with (SEEDED_EMAIL_DOMAIN, or a subdomain of it), compared without regard to case: the placeholder of the administrator the server was installed with.
    static boolean
    Checks whether an application ID is one of ServerAdmin's (SERVER_ADMIN_APP_IDS).
    static String
    Decides whether a database user is a member of an enabled administrators group, whether the user itself is enabled or not.
    static boolean
    Checks if the user of a session must still enter a real e-mail address (emailRefusal(BasicUserInfo)), the user read from the database again: what the SignIn module asks before it hands over.
    Gets the password policy that applies to a user: the administrators' for a member of the administrators group, the users' for everyone else and for a user that does not exist - the one rule, which the SignIn module's change of password and ServerAdmin's Edit user share (CC-ACCOUNT-EMAIL-PASSWORD, AE-1; before it, UserAuthenticationUIImpl.policyFor).
    static String
    Decides whether a database user may administer the server.
    static String
    Decides whether an authenticated user may administer the server.
    static String
    Decides whether the user of a running session may administer the server NOW: the user is read from the database again, so that a user disabled, deleted or taken out of the administrators group while signed in is refused, and so is one who must still change the password - the first sign-in of an administrator the server was installed with can do nothing but change it (the owner's rulings SA-1 and SA-2b-1 of CC-SERVERADMIN-SIGNIN) - and one who has no real e-mail address yet (emailRefusal(BasicUserInfo), the owner's ruling ADM-D-1 of 2026-10-18): the SignIn module asks for it before it hands over.
    Sets the real e-mail address of an administrator who must enter one (emailRefusal(BasicUserInfo)): at once and not verified - the verification follows the sign-in policy's emailVerificationDays - and the cached user is refreshed.
  • Field Details

    • SERVER_ADMIN_APP_IDS

      public static final Set<String> SERVER_ADMIN_APP_IDS
      The application IDs of ServerAdmin (decision B5D-D-b): com.iizix.serveradmin, the ID of its module (iiziServer\apps\ServerAdmin\.iiziModuleProject) and of every launcher since CC-FIX-SERVERADMIN-APPID (iiziServer\bin\iiziServer.bat, .sh, BuildUtil\LinuxCommands\launchServer.sh), and com.iizix.server.admin, the ID the shipped launchers gave it up to r20656, which a server configured by hand may still name. Matched against the application's own ID, never an alias.

      The one place the server knows them (CC-FIX-SERVERADMIN-GATE-UNDECLARED, PL-D-6 (a)): the licence lets them past on an unlicensed server (LicenseCounter), and an application of one of them must have its gate - the session and every sign-in are refused when its first module declares none (AppSessionGyro, UserAuthentication).

    • SEEDED_EMAIL_DOMAIN

      public static final String SEEDED_EMAIL_DOMAIN
      The domain of the e-mail address the server's database gives its administrator (createBaseTables.sql: default@iizi.server.administrator). No mailbox is there: a "Forgot password?" of such an account mails into the void.
      See Also:
  • Method Details

    • isServerAdmin

      public static boolean isServerAdmin(String appID)
      Checks whether an application ID is one of ServerAdmin's (SERVER_ADMIN_APP_IDS).
      Parameters:
      appID - The application's own ID (not an alias), null for none.
      Returns:
      true for an ID of ServerAdmin, matched exactly, false otherwise and for null.
    • refusal

      public static String refusal(IAuthenticatedUser user) throws SQLException, NotFoundException
      Decides whether an authenticated user may administer the server.
      Parameters:
      user - The authenticated user, null or undefined when nobody has signed in.
      Returns:
      null when admitted, otherwise the reason of the refusal, for the log.
      Throws:
      SQLException - For SQL errors reading the groups.
      NotFoundException - If a group of the user has been deleted.
    • refusal

      public static String refusal(BasicUserInfo user) throws SQLException, NotFoundException
      Decides whether a database user may administer the server.
      Parameters:
      user - The user.
      Returns:
      null when admitted, otherwise the reason of the refusal, for the log.
      Throws:
      SQLException - For SQL errors reading the groups.
      NotFoundException - If a group of the user has been deleted.
    • sessionRefusal

      public static String sessionRefusal(IAuthenticatedUser user) throws SQLException, NotFoundException
      Decides whether the user of a running session may administer the server NOW: the user is read from the database again, so that a user disabled, deleted or taken out of the administrators group while signed in is refused, and so is one who must still change the password - the first sign-in of an administrator the server was installed with can do nothing but change it (the owner's rulings SA-1 and SA-2b-1 of CC-SERVERADMIN-SIGNIN) - and one who has no real e-mail address yet (emailRefusal(BasicUserInfo), the owner's ruling ADM-D-1 of 2026-10-18): the SignIn module asks for it before it hands over.
      Parameters:
      user - The session's user, null or undefined when nobody has signed in.
      Returns:
      null when admitted, otherwise the reason of the refusal, for the log.
      Throws:
      SQLException - For SQL errors reading the user or the groups.
      NotFoundException - If a group of the user has been deleted.
    • isSeededEmail

      public static boolean isSeededEmail(String email)
      Checks if an e-mail address is in the domain the database was created with (SEEDED_EMAIL_DOMAIN, or a subdomain of it), compared without regard to case: the placeholder of the administrator the server was installed with.
      Parameters:
      email - The address, null for none.
      Returns:
      true for an address in that domain, false otherwise and for none.
    • isRealEmail

      public static boolean isRealEmail(String email)
      Checks if an address an administrator enters is a real one: well formed (EmailAddressForm) and not in the seeded domain (isSeededEmail(String)).
      Parameters:
      email - The address as typed, null for none.
      Returns:
      true for a real address.
    • emailRefusal

      public static String emailRefusal(BasicUserInfo user) throws SQLException, NotFoundException
      Decides whether a database user must enter a real e-mail address before administering the server (the owner's ruling ADM-D-1, 2026-10-18): a member of an enabled administrators group whose address is in the seeded domain (isSeededEmail(String)) - the account the server was installed with - or who has NO address at all (hasNoEmail(String); the owner's ruling UX-D-6 of CC-FIX-SIGNIN-V5-UX, 2026-10-18 23:12: a forgotten password of such an account cannot be reset either). An external Sign In Provider's account is never asked: its address comes from the provider. The verification of the address follows the sign-in policy's emailVerificationDays, as for every address.
      Parameters:
      user - The user, as read from the database.
      Returns:
      null when no address is needed, otherwise the reason, for the log.
      Throws:
      SQLException - For SQL errors reading the groups.
      NotFoundException - If a group of the user has been deleted.
    • hasNoEmail

      public static boolean hasNoEmail(String email)
      Checks if an account has no e-mail address at all: null or blank (UX-D-6).
      Parameters:
      email - The address, null for none.
      Returns:
      true for none.
    • needsRealEmail

      public static boolean needsRealEmail(IAuthenticatedUser user)
      Checks if the user of a session must still enter a real e-mail address (emailRefusal(BasicUserInfo)), the user read from the database again: what the SignIn module asks before it hands over.
      Parameters:
      user - The session's user, null or undefined when nobody has signed in.
      Returns:
      true when the address is needed; false otherwise, and when it cannot be told (logged): ServerAdmin's gate, which reads the same rule, refuses then.
    • setRealEmail

      public static AdministratorAccess.EmailOutcome setRealEmail(IAuthenticatedUser user, String email)
      Sets the real e-mail address of an administrator who must enter one (emailRefusal(BasicUserInfo)): at once and not verified - the verification follows the sign-in policy's emailVerificationDays - and the cached user is refreshed. The caller mails the verification link (the SignIn module, resendVerificationMail). Every other account changes its address by a link mailed to the new address, or in ServerAdmin.
      Parameters:
      user - The signed-in user.
      email - The address as typed.
      Returns:
      What became of it.
    • memberRefusal

      public static String memberRefusal(BasicUserInfo user) throws SQLException, NotFoundException
      Decides whether a database user is a member of an enabled administrators group, whether the user itself is enabled or not.
      Parameters:
      user - The user.
      Returns:
      null for a member, otherwise the reason, for the log.
      Throws:
      SQLException - For SQL errors reading the groups.
      NotFoundException - If a group of the user has been deleted.
    • passwordPolicyFor

      public static PasswordPolicy passwordPolicyFor(ServerSettings settings, BasicUserInfo bui)
      Gets the password policy that applies to a user: the administrators' for a member of the administrators group, the users' for everyone else and for a user that does not exist - the one rule, which the SignIn module's change of password and ServerAdmin's Edit user share (CC-ACCOUNT-EMAIL-PASSWORD, AE-1; before it, UserAuthenticationUIImpl.policyFor).
      Parameters:
      settings - The server settings.
      bui - The user, null for none.
      Returns:
      The policy.