Skip to content

Commit

Permalink
Added setUser methdo on ESUserVerifier interface
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarmueller committed Feb 12, 2015
1 parent eba6068 commit 4738ecf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@

import org.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl;
import org.eclipse.emf.emfstore.internal.server.model.AuthenticationInformation;
import org.eclipse.emf.emfstore.internal.server.model.accesscontrol.ACUser;
import org.eclipse.emf.emfstore.server.model.ESAuthenticationInformation;
import org.eclipse.emf.emfstore.server.model.ESUser;

import com.google.common.base.Preconditions;

/**
* Mapping between {@link ESAuthenticationInformation} and {@link AuthenticationInformation}.
*
Expand Down Expand Up @@ -44,4 +47,15 @@ public ESUser getUser() {
// TODO: double check
return toInternalAPI().getResolvedACUser().toAPI();
}

/**
* {@inheritDoc}
*
* @see org.eclipse.emf.emfstore.server.model.ESAuthenticationInformation#setUser(org.eclipse.emf.emfstore.server.model.ESUser)
*/
public void setUser(ESUser user) {
Preconditions.checkNotNull(user);
toInternalAPI().setResolvedACUser(
(ACUser) ESUserImpl.class.cast(user).toInternalAPI());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ public interface ESAuthenticationInformation {

/**
* Returns the authenticated user.
*
*
* @return the authenticated user
*/
ESUser getUser();

/**
* Sets the authenticated user.
*
* @param user
* the authenticated user
*/
void setUser(ESUser user);

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public interface ESUserVerifier {
* @param clientVersionInfo
* the version of the client
* @return an {@link ESAuthenticationInformation} instance holding information about the
* logged-in session
* logged-in session. Note that the return {@link ESAuthenticationInformation} must
* hold an {@link org.eclipse.emf.emfstore.server.model.ESUser ESUser}
*
* @throws AccessControlException in case the login fails
*/
Expand Down

0 comments on commit 4738ecf

Please sign in to comment.