com.servicerocket.confluence.randombits.support.core.env.atlassian.UserProfileProvider Maven / Gradle / Ivy
package com.servicerocket.confluence.randombits.support.core.env.atlassian;
import com.atlassian.sal.api.user.UserManager;
import com.atlassian.sal.api.user.UserProfile;
import com.servicerocket.confluence.randombits.support.core.env.SimpleEnvironmentProvider;
/**
* Provides the {@link UserProfile} for the currently-logged-in user.
*/
public class UserProfileProvider extends SimpleEnvironmentProvider {
private final UserManager userManager;
public UserProfileProvider( UserManager userManager ) {
this.userManager = userManager;
}
@Override
protected UserProfile getValue() {
return userManager.getRemoteUser();
}
}