Class SecurityUtils<T extends Serializable>

java.lang.Object
systems.dennis.shared.utils.ApplicationContext
systems.dennis.shared.auth_client.SecurityUtils<T>
All Implemented Interfaces:
systems.dennis.shared.annotations.security.ISecurityUtils<T>

@Service public class SecurityUtils<T extends Serializable> extends systems.dennis.shared.utils.ApplicationContext implements systems.dennis.shared.annotations.security.ISecurityUtils<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
     
    static String
     
    static final String
     

    Fields inherited from interface systems.dennis.shared.annotations.security.ISecurityUtils

    USER_ID_FIELD
  • Constructor Summary

    Constructors
    Constructor
    Description
    SecurityUtils(systems.dennis.shared.config.WebContext context, jakarta.servlet.http.HttpServletRequest request)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assignUser(systems.dennis.shared.entity.AbstractEntity<T> pojo)
     
    void
    assignUser(systems.dennis.shared.entity.AbstractEntity<T> pojo, systems.dennis.shared.entity.AbstractEntity<T> pojoOriginal)
     
    get()
     
    systems.dennis.shared.entity.TokenData
     
     
     
    boolean
     
    boolean
     
     

    Methods inherited from class systems.dennis.shared.utils.ApplicationContext

    canEqual, equals, getBean, getContext, getCurrentUser, getDefaultLogger, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface systems.dennis.shared.annotations.security.ISecurityUtils

    belongsToMeQuery, belongsToMeSpecification, isMy
  • Field Details

    • AUTHORIZATION_HEADER

      public static final String AUTHORIZATION_HEADER
      See Also:
    • AUTH_TYPE_HEADER

      public static String AUTH_TYPE_HEADER
    • AUTH_SCOPE_HEADER

      public static String AUTH_SCOPE_HEADER
  • Constructor Details

    • SecurityUtils

      public SecurityUtils(systems.dennis.shared.config.WebContext context, jakarta.servlet.http.HttpServletRequest request)
  • Method Details

    • getUserDataId

      public T getUserDataId()
      Specified by:
      getUserDataId in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • tokenFromHeader

      public UserTokenDTO tokenFromHeader() throws systems.dennis.shared.exceptions.AuthorizationNotFoundException
      Throws:
      systems.dennis.shared.exceptions.AuthorizationNotFoundException
    • getToken

      public systems.dennis.shared.entity.TokenData getToken()
      Specified by:
      getToken in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • assignUser

      public void assignUser(systems.dennis.shared.entity.AbstractEntity<T> pojo)
      Specified by:
      assignUser in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • assignUser

      public void assignUser(systems.dennis.shared.entity.AbstractEntity<T> pojo, systems.dennis.shared.entity.AbstractEntity<T> pojoOriginal)
      Specified by:
      assignUser in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • isAdmin

      public boolean isAdmin()
      Specified by:
      isAdmin in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • hasRole

      public boolean hasRole(String role)
      Specified by:
      hasRole in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • getUserLanguage

      public String getUserLanguage()
      Specified by:
      getUserLanguage in interface systems.dennis.shared.annotations.security.ISecurityUtils<T extends Serializable>
    • get

      public UserTokenDTO get()