01: package org.acegisecurity.ui.switchuser;
02:
03: import java.util.List;
04:
05: import org.acegisecurity.Authentication;
06: import org.acegisecurity.GrantedAuthority;
07: import org.acegisecurity.userdetails.UserDetails;
08:
09: /**
10: * Allows subclasses to modify the {@link GrantedAuthority} list that will be assigned to the principal
11: * when they assume the identity of a different principal.
12: *
13: * <p>Configured against the {@link SwitchUserProcessingFilter}.
14: *
15: * @author Ben Alex
16: * @version $Id$
17: *
18: */
19: public interface SwitchUserAuthorityChanger {
20:
21: /**
22: * Allow subclasses to add or remove authorities that will be granted when in switch user mode.
23: *
24: * @param targetUser the UserDetails representing the identity being switched to
25: * @param currentAuthentication the current Authentication of the principal performing the switching
26: * @param authoritiesToBeGranted all {@link GrantedAuthority} instances to be granted to the user,
27: * excluding the special "switch user" authority that is used internally (guaranteed never null)
28: */
29: void modifyGrantedAuthorities(UserDetails targetUser,
30: Authentication currentAuthentication,
31: List authoritiesToBeGranted);
32: }
|