class AuthorizationsUtil {

    public static String buildUserAuthorizationString(Principal principal) {
        String auths = "";
        if (principal != null && (principal instanceof DatawavePrincipal)) {
            DatawavePrincipal datawavePrincipal = (DatawavePrincipal) principal;
            
            auths = new Authorizations(datawavePrincipal.getPrimaryUser().getAuths().toArray(new String[0])).toString();
        }
        return auths;
    }

}