Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Select Git revision
  • 3c03905bb23eaf9d1738a2d404276b4f75881e30
  • development default
  • bugfix/EDELIVERY-14172-domismp-accepts-requests-with-wrong-domain-header-value
  • EDELIVERY-15372-upgrade-libraries-and-plugins-and-update-httpclient-to-httpclient5
  • EDELIVERY-15377-migrate-to-angular-20
  • feature/EDELIVERY-15382-rest-api-jwt-authentication-for-dynamic-discovery-client
  • bugfix/EDELIVERY-14196-select-domain-select-resource-dropdown-should-be-order-alphabetically
  • feature/EDELIVERY-12753-sml-integration-migration-to-different-smp
  • feature/EDELIVERY-13757-extend-session-dialog-should-have-an-active-counter
  • EDELIVERY-15144-sql-update
  • bugfix/EDELIVERY-14326-ui-edit-resource-filters
  • feature/EDELIVERY-15144-domismp-system-notification-generalize-time-expiration-alerts
  • bugfix/EDELIVERY-15102-alert-is-not-appearing-when-adding-duplicated-certificate
  • bugfix/EDELIVERY-15203-small-left-grid-shows-no-data-found-for-1-2-seconds-before-loading-the-data
  • EDELIVERY-15219-search-filter-with-understore-char-does-not-work
  • bugfix/EDELIVERY-15226-certificates-error-when-trying-to-delete-certificates
  • bugfix/EDELIVERY-15224-error-when-trying-to-update-info-from-profile-page
  • bugfix/EDELIVERY-15225-emails-are-not-sent-in-domismp
  • release/5.1.x
  • feature/EDELIVERY-12746-external-secret-sharing-services-as-vaults
  • EDELIVERY-15229-upgrade-libraries-and-plugins
  • 5.1.1
  • 5.1
  • 5.1-TEST
  • 5.1-RC1
  • 5.0.1
  • 5.0
  • 5.0-RC1
  • 4.2
  • 4.2-RC1
  • 4.1.2
  • 4.1.1
  • 4.1.0
  • 4.1.0-RC1
  • 4.0.0
  • 4.0.0-RC1
  • 3.0.2
  • 3.0.1
  • 3.0.0
39 results

UserModel.java

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    UserModel.java 3.51 KiB
    package rest.models;
    
    
    import ddsl.enums.ApplicationRoles;
    import ddsl.enums.SMPThemes;
    import utils.Generator;
    
    public class UserModel {
    
        private String userId;
        private String username;
        private boolean active;
        private String role;
        private String emailAddress;
        private String fullName;
        private String smpTheme;
        private String smpLocale;
    
        public UserModel(String username, boolean active, String role, String emailAddress, String fullName, String smpTheme, String smpLocale) {
            this.username = username;
            this.active = active;
            this.role = role;
            this.emailAddress = emailAddress;
            this.fullName = fullName;
            this.smpTheme = smpTheme;
            this.smpLocale = smpLocale;
        }
    
        public UserModel() {
        }
    
        public String getUserId() {
            return userId;
        }
    
        public void setUserId(String userId) {
            this.userId = userId;
        }
    
        public boolean isActive() {
            return active;
        }
    
        public void setActive(boolean active) {
            this.active = active;
        }
    
        public String getUsername() {
            return username;
        }
    
        public void setUsername(String username) {
            this.username = username;
        }
    
        public String getRole() {
            return role;
        }
    
        public void setRole(String role) {
            this.role = role;
        }
    
        public String getEmailAddress() {
            return emailAddress;
        }
    
        public void setEmailAddress(String email) {
            this.emailAddress = email;
        }
    
        public String getFullName() {
            return fullName;
        }
    
        public void setFullName(String fullName) {
            this.fullName = fullName;
        }
    
        public String getSmpTheme() {
            return smpTheme;
        }
    
        public void setSmpTheme(String smpTheme) {
            this.smpTheme = smpTheme;
        }
    
    
        public String getSmpLocale() {
            return smpLocale;
        }
    
        public void setSmpLocale(String smpLocale) {
            this.smpLocale = smpLocale;
        }
    
        public static UserModel createUserWithUSERrole() {
            UserModel userModel = new UserModel();
            userModel.username = ("AUT_username_" + Generator.randomAlphaNumeric(4)).toLowerCase();
            userModel.active = true;
            userModel.role = ApplicationRoles.USER;
            userModel.emailAddress = "AUT_email_" + Generator.randomAlphaNumeric(4) + "@automation.com";
            userModel.fullName = "AUT_fullname_" + Generator.randomAlphaNumeric(4);
            userModel.smpTheme = SMPThemes.getRandomTheme();
            userModel.smpLocale = "English";
            return userModel;
        }
    
        public static UserModel createUserWithADMINrole() {
            UserModel userModel = new UserModel();
            userModel.username = ("AUT_username_" + Generator.randomAlphaNumeric(4)).toLowerCase();
            userModel.active = true;
            userModel.role = ApplicationRoles.SYSTEM_ADMIN;
            userModel.emailAddress = "AUT_email_" + Generator.randomAlphaNumeric(4) + "@automation.com";
            userModel.fullName = "AUT_fullname_" + Generator.randomAlphaNumeric(4);
            userModel.smpTheme = SMPThemes.getRandomTheme();
            userModel.smpLocale = "English";
            return userModel;
        }
    
        public static UserModel generateUserProfileData() {
            UserModel userModel = new UserModel();
            userModel.emailAddress = "AUT_email_" + Generator.randomAlphaNumeric(4) + "@automation.com";
            userModel.fullName = "AUT_fullname_" + Generator.randomAlphaNumeric(4);
            userModel.smpTheme = SMPThemes.getRandomTheme();
            userModel.smpLocale = "Dutch";
            return userModel;
        }
    
    }