001 package org.nakedobjects.applib.switchuser;
002
003 import org.nakedobjects.applib.fixtures.AbstractFixture;
004 import org.nakedobjects.applib.profiles.ProfileService;
005
006
007 /**
008 * Not intended to be used directly; decouples the {@link AbstractFixture}, which needs to
009 * be able to switch users dynamically, from the rest of the framework's runtime.
010 *
011 * <p>
012 * A suitable implementation is injected into {@link AbstractFixture} when installed.
013 *
014 * @see ProfileService
015 */
016 public interface SwitchUserService {
017
018 /**
019 * Switches the current user with the list of specified roles.
020 */
021 void switchUser(String username, String... roles);
022 }
023
024 // Copyright (c) Naked Objects Group Ltd.