public void setForcedUser ( int contextId , int userId ) throws IllegalStateException { User user = getUserManagementExtension ( ) . getContextUserAuthManager ( contextId ) . getUserById ( userId ) ; if ( user == null ) throw new IllegalStateException ( "No user matching the provided id was found." ) ; setForcedUser ( contextId , user ) ; }
Sets the forced user for a context based on the user id .