Package edu.ucsb.cs156.dining.services
Class CurrentUserServiceImpl
java.lang.Object
edu.ucsb.cs156.dining.services.CurrentUserService
edu.ucsb.cs156.dining.services.CurrentUserServiceImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the current user as a CurrentUser objectgetOAuth2AuthenticatedUser(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication) Collection<? extends org.springframework.security.core.GrantedAuthority> getRoles()This method returns the roles of the current user.getUser()This method returns the current user as a User object.Methods inherited from class edu.ucsb.cs156.dining.services.CurrentUserService
isLoggedIn
-
Constructor Details
-
CurrentUserServiceImpl
public CurrentUserServiceImpl()
-
-
Method Details
-
getCurrentUser
Description copied from class:CurrentUserServiceThis method returns the current user as a CurrentUser object- Specified by:
getCurrentUserin classCurrentUserService- Returns:
- the current user
-
getOAuth2AuthenticatedUser
public User getOAuth2AuthenticatedUser(org.springframework.security.core.context.SecurityContext securityContext, org.springframework.security.core.Authentication authentication) -
getUser
Description copied from class:CurrentUserServiceThis method returns the current user as a User object.- Specified by:
getUserin classCurrentUserService- Returns:
- the current user
-
getRoles
Description copied from class:CurrentUserServiceThis method returns the roles of the current user.- Specified by:
getRolesin classCurrentUserService- Returns:
- a collection of roles
-