Class CurrentUserServiceImpl

java.lang.Object
edu.ucsb.cs156.dining.services.CurrentUserService
edu.ucsb.cs156.dining.services.CurrentUserServiceImpl

@Service("currentUser") @Primary public class CurrentUserServiceImpl extends CurrentUserService
  • Constructor Details

    • CurrentUserServiceImpl

      public CurrentUserServiceImpl()
  • Method Details

    • getCurrentUser

      public CurrentUser getCurrentUser()
      Description copied from class: CurrentUserService
      This method returns the current user as a CurrentUser object
      Specified by:
      getCurrentUser in class CurrentUserService
      Returns:
      the current user
    • getOAuth2AuthenticatedUser

      public User getOAuth2AuthenticatedUser(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication)
    • getUser

      public User getUser()
      Description copied from class: CurrentUserService
      This method returns the current user as a User object.
      Specified by:
      getUser in class CurrentUserService
      Returns:
      the current user
    • getRoles

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getRoles()
      Description copied from class: CurrentUserService
      This method returns the roles of the current user.
      Specified by:
      getRoles in class CurrentUserService
      Returns:
      a collection of roles