Class CurrentUserServiceImpl
java.lang.Object
edu.ucsb.cs156.gauchoride.services.CurrentUserService
edu.ucsb.cs156.gauchoride.services.CurrentUserServiceImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOAuth2AuthenticatedUser(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication) Collection<? extends org.springframework.security.core.GrantedAuthority>getRoles()getUser()voidThis should only be called in test code, never in production code! It resets the current user to a known state for tests, in case a previous test has changed it in some way.Methods inherited from class edu.ucsb.cs156.gauchoride.services.CurrentUserService
isLoggedIn
-
Constructor Details
-
CurrentUserServiceImpl
public CurrentUserServiceImpl()
-
-
Method Details
-
getCurrentUser
- Specified by:
getCurrentUserin classCurrentUserService
-
getOAuth2AuthenticatedUser
public User getOAuth2AuthenticatedUser(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication) -
getUser
- Specified by:
getUserin classCurrentUserService
-
getRoles
- Specified by:
getRolesin classCurrentUserService
-
resetCurrentUser
public void resetCurrentUser()Description copied from class:CurrentUserServiceThis should only be called in test code, never in production code! It resets the current user to a known state for tests, in case a previous test has changed it in some way.- Specified by:
resetCurrentUserin classCurrentUserService
-