java.lang.Object
com.broadleafcommerce.adminuser.user.provider.jpa.domain.JpaAdminUser
All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, Serializable

@Entity public class JpaAdminUser extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
Author:
Nathan Moore (nathanmoore)., Samarth Dhruva (samarthd)
See Also:
  • Constructor Details

    • JpaAdminUser

      public JpaAdminUser()
  • Method Details

    • setNotificationStates

      public void setNotificationStates(List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> notificationStates)
      Specified by:
      setNotificationStates in interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
    • getNotificationStates

      public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates()
      Specified by:
      getNotificationStates in interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
    • getNotificationStates

      public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates(boolean fetch)
      Specified by:
      getNotificationStates in interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
    • fromMe

      public org.modelmapper.ModelMapper fromMe()
      Specified by:
      fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • toMe

      public org.modelmapper.ModelMapper toMe()
      Specified by:
      toMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • fromMePostConverter

      protected org.modelmapper.Converter<JpaAdminUser,AdminUser> fromMePostConverter()
    • toMePostConverter

      protected <U extends AdminUser, J extends JpaAdminUser> J toMePostConverter(org.modelmapper.spi.MappingContext<U,J> mappingContext)
      Used as the TypeMap.setPostConverter(Converter) for JpaAdminUser in toMe().

      For each of the parent-user back-references in managed collections like getRestrictions(), getRestrictedRoles(), and getRestrictedPermissions() explicitly sets their value to the user instance being mapped.

      As documented in TypeMap.include(Class, Class), extensions will not automatically inherit this converter, and must manually set it on the extended type map.

      Parameters:
      mappingContext - the model mapper mapping context
      Returns:
      the persisted-domain user after setting each of its managed collection items' parent references to itself
    • postToMe

      public void postToMe(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain)
      Specified by:
      postToMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • getBusinessDomainType

      public Class<?> getBusinessDomainType()
      Specified by:
      getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
    • getId

      public String getId()
    • getName

      public String getName()
    • getUsername

      public String getUsername()
    • getEmail

      public String getEmail()
    • getPhone

      public String getPhone()
    • getDefaultCommunicationPreference

      public String getDefaultCommunicationPreference()
    • isActive

      public boolean isActive()
    • isChangePasswordRequired

      public boolean isChangePasswordRequired()
    • isLocked

      public boolean isLocked()
    • isExpired

      public boolean isExpired()
    • isGlobal

      public boolean isGlobal()
      If true, this user is a global user, meaning that they can access the global applications. If not, the user can only access the applications they are assigned to via applicationIds.
      Returns:
      true if the user is a global user which can access global applications, false if the user can only access applications they are assigned to
    • isGrantAnyAuthorityAllowed

      public boolean isGrantAnyAuthorityAllowed()
      If true, this user can grant any authority, meaning that it can grant any roles or permissions to any users without needing to have those permissions itself. If false, it can only assign authorities that the user itself has, either directly assigned or inherited from #roles.
      Returns:
      true if the admin user can grant any authority, false if the user can only grant authority that the user itself has
    • getRestrictions

      public Set<JpaAdminUserRestriction> getRestrictions()
      See Also:
    • getRestrictedRoles

      public Set<JpaAdminUserRestrictedRole> getRestrictedRoles()
      See Also:
    • getRestrictedPermissions

      public Set<JpaAdminUserRestrictedPermission> getRestrictedPermissions()
      See Also:
    • getApplicationIds

      public Set<String> getApplicationIds()
    • getDefaultApplicationId

      public String getDefaultApplicationId()
    • getTenantId

      public String getTenantId()
    • isTenantUser

      @Deprecated public boolean isTenantUser()
      Deprecated.
      in favor of tenantAccess
    • isTenantAccess

      public boolean isTenantAccess()
    • isApplicationAccess

      public boolean isApplicationAccess()
    • getRoleIds

      public Set<String> getRoleIds()
    • getPermissionIds

      public Set<String> getPermissionIds()
    • getDefaultTimeZone

      public String getDefaultTimeZone()
    • setId

      public void setId(String id)
    • setName

      public void setName(String name)
    • setUsername

      public void setUsername(String username)
    • setEmail

      public void setEmail(String email)
    • setPhone

      public void setPhone(String phone)
    • setDefaultCommunicationPreference

      public void setDefaultCommunicationPreference(String defaultCommunicationPreference)
    • setActive

      public void setActive(boolean active)
    • setChangePasswordRequired

      public void setChangePasswordRequired(boolean changePasswordRequired)
    • setLocked

      public void setLocked(boolean locked)
    • setExpired

      public void setExpired(boolean expired)
    • setGlobal

      public void setGlobal(boolean global)
      If true, this user is a global user, meaning that they can access the global applications. If not, the user can only access the applications they are assigned to via applicationIds.
      Parameters:
      global - true if the user is a global user which can access global applications, false if the user can only access applications they are assigned to
    • setGrantAnyAuthorityAllowed

      public void setGrantAnyAuthorityAllowed(boolean grantAnyAuthorityAllowed)
      If true, this user can grant any authority, meaning that it can grant any roles or permissions to any users without needing to have those permissions itself. If false, it can only assign authorities that the user itself has, either directly assigned or inherited from #roles.
      Parameters:
      grantAnyAuthorityAllowed - true if the user can grant any authority, false if the user can only grant authority that the user itself has
    • setRestrictions

      public void setRestrictions(Set<JpaAdminUserRestriction> restrictions)
      See Also:
    • setRestrictedRoles

      public void setRestrictedRoles(Set<JpaAdminUserRestrictedRole> restrictedRoles)
      See Also:
    • setRestrictedPermissions

      public void setRestrictedPermissions(Set<JpaAdminUserRestrictedPermission> restrictedPermissions)
      See Also:
    • setApplicationIds

      public void setApplicationIds(Set<String> applicationIds)
    • setDefaultApplicationId

      public void setDefaultApplicationId(String defaultApplicationId)
    • setTenantId

      public void setTenantId(String tenantId)
    • setTenantUser

      @Deprecated public void setTenantUser(boolean tenantUser)
      Deprecated.
      in favor of tenantAccess
    • setTenantAccess

      public void setTenantAccess(boolean tenantAccess)
    • setApplicationAccess

      public void setApplicationAccess(boolean applicationAccess)
    • setRoleIds

      public void setRoleIds(Set<String> roleIds)
    • setPermissionIds

      public void setPermissionIds(Set<String> permissionIds)
    • setDefaultTimeZone

      public void setDefaultTimeZone(String defaultTimeZone)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object