package org.slc.sli.util;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

import org.slc.sli.security.SLIPrincipal;


/**
 * Class, which allows user to access security context
 * @author svankina
 *
 */
public class SecurityUtil {

    public static UserDetails getPrincipal() {
        return  (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
    
    public static String getToken() {
        UserDetails user = getPrincipal();
        if (user instanceof SLIPrincipal) {
            return ((SLIPrincipal) user).getId();
        }
        
        return null;
    }
    
}

@@ -680,24 +680,31 @@
 ;%0D%0A        %7D
+ else %7B
 %0D%0A        %0D%0A
@@ -705,30 +705,95 @@
     
-%0D%0A        return null;
+    // gets here in mock server mode%0D%0A            return user.getUsername();%0D%0A        %7D
 %0D%0A  

Make security util to work for mock dashboard server mode.