Class ServerPrincipal

    • Constructor Detail

      • ServerPrincipal

        public ServerPrincipal​(@Nullable
                               String realm,
                               @NotNull
                               String name)
        Parameters:
        realm - - obsolete, should generally be null
        name - TeamCity's username
      • ServerPrincipal

        public ServerPrincipal​(@Nullable
                               String realm,
                               @NotNull
                               String name,
                               @Nullable
                               AuthPropertyKey usernamePropertyKey,
                               boolean creatingNewUserAllowed,
                               @NotNull
                               Map<PropertyKey,​String> newUserProperties)
        Parameters:
        realm - - obsolete, should generally be null
        name - either TeamCity's username (if usernamePropertyKey is null) or custom username that is held in user usernamePropertyKey property
        usernamePropertyKey - the name of the user property to look for the custom username specified in the name parameter
        creatingNewUserAllowed - true to allow creating the user if he/she does not exist yet, false otherwise
        newUserProperties - Adds user properties to the user in case he/she is created during login. Has no effect for already existing users. Also has no effect if creatingNewUserAllowed is set to false.
        Since:
        8.0
      • ServerPrincipal

        public ServerPrincipal​(@Nullable
                               String realm,
                               @NotNull
                               String name,
                               @Nullable
                               AuthPropertyKey usernamePropertyKey,
                               boolean creatingNewUserAllowed,
                               @NotNull
                               Map<PropertyKey,​String> newUserProperties,
                               @Nullable
                               PermissionsHolder permissionsHolder)
        Parameters:
        realm - - obsolete, should generally be null
        name - either TeamCity's username (if usernamePropertyKey is null) or custom username that is held in user usernamePropertyKey property
        usernamePropertyKey - the name of the user property to look for the custom username specified in the name parameter
        creatingNewUserAllowed - true to allow creating the user if he/she does not exist yet, false otherwise
        newUserProperties - Adds user properties to the user in case he/she is created during login. Has no effect for already existing users. Also has no effect if creatingNewUserAllowed is set to false.
        permissionsRestrictor - Won't have any effect if null. If not null the the user created from this Principal will be restricted: remember me won't be used; permissions of the user will be restricted with this instance;
        Since:
        2020.1.1