//# 0 errors, 422 messages
//#
/*
    //#securityutils.java:1:1: class: net.sourceforge.pebble.util.SecurityUtils
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.util;

import net.sourceforge.pebble.Constants;
import net.sourceforge.pebble.PebbleContext;
import net.sourceforge.pebble.domain.Blog;
import net.sourceforge.pebble.security.PebbleUserDetails;
import net.sourceforge.pebble.security.SecurityRealm;
import net.sourceforge.pebble.security.SecurityRealmException;
import org.acegisecurity.Authentication;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.providers.TestingAuthenticationToken;
import org.acegisecurity.providers.encoding.Md5PasswordEncoder;
import org.acegisecurity.providers.encoding.PasswordEncoder;
import org.acegisecurity.providers.encoding.PlaintextPasswordEncoder;
import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.List;

/**
 * A collection of utility methods for security.
 *
 * @author    Simon Brown
 */
public final class SecurityUtils {
    //#securityutils.java:60: method: void net.sourceforge.pebble.util.SecurityUtils.net.sourceforge.pebble.util.SecurityUtils()
    //#securityutils.java:60: end of method: void net.sourceforge.pebble.util.SecurityUtils.net.sourceforge.pebble.util.SecurityUtils()

  private static final Log log = LogFactory.getLog(SecurityUtils.class);
    //#securityutils.java:62: method: net.sourceforge.pebble.util.SecurityUtils.net.sourceforge.pebble.util.SecurityUtils__static_init
    //#securityutils.java:62: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: net.sourceforge.pebble.util.SecurityUtils__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.util.SecurityUtils__static_init): __Descendant_Table[net/sourceforge/pebble/util/SecurityUtils]
    //#output(net.sourceforge.pebble.util.SecurityUtils__static_init): log
    //#post(net.sourceforge.pebble.util.SecurityUtils__static_init): __Descendant_Table[net/sourceforge/pebble/util/SecurityUtils] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.util.SecurityUtils__static_init): init'ed(log)
    //#securityutils.java:62: end of method: net.sourceforge.pebble.util.SecurityUtils.net.sourceforge.pebble.util.SecurityUtils__static_init

  public static String getUsername() {
    SecurityContext ctx = SecurityContextHolder.getContext();
    //#securityutils.java:65: method: String net.sourceforge.pebble.util.SecurityUtils.getUsername()
    //#securityutils.java:65: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: String getUsername()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#output(String getUsername()): return_value
    //#presumption(String getUsername()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@65 != null
    //#post(String getUsername()): init'ed(return_value)
    //#unanalyzed(String getUsername()): Effects-of-calling:org.acegisecurity.Authentication:getName
    Authentication auth = ctx.getAuthentication();
    //#securityutils.java:66: Warning: method not available
    //#    -- call on Authentication org.acegisecurity.context.SecurityContext:getAuthentication()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: String getUsername()
    //#    unanalyzed callee: Authentication org.acegisecurity.context.SecurityContext:getAuthentication()
    return getUsername(auth);
    //#securityutils.java:67: end of method: String net.sourceforge.pebble.util.SecurityUtils.getUsername()
  }

  public static String getUsername(Authentication auth) {
    if (auth != null) {
    //#securityutils.java:71: method: String net.sourceforge.pebble.util.SecurityUtils.getUsername(Authentication)
    //#input(String getUsername(Authentication)): auth
    //#output(String getUsername(Authentication)): return_value
    //#post(String getUsername(Authentication)): init'ed(return_value)
    //#test_vector(String getUsername(Authentication)): auth: Addr_Set{null}, Inverse{null}
      return auth.getName();
    //#securityutils.java:72: Warning: method not available
    //#    -- call on String org.acegisecurity.Authentication:getName()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: String getUsername(Authentication)
    //#    unanalyzed callee: String org.acegisecurity.Authentication:getName()
    } else {
      return null;
    //#securityutils.java:74: end of method: String net.sourceforge.pebble.util.SecurityUtils.getUsername(Authentication)
    }
  }

  public static PebbleUserDetails getUserDetails() {
    try {
      SecurityRealm realm = PebbleContext.getInstance().getConfiguration().getSecurityRealm();
    //#securityutils.java:80: method: PebbleUserDetails net.sourceforge.pebble.util.SecurityUtils.getUserDetails()
    //#securityutils.java:80: Warning: method not available
    //#    -- call on SecurityRealm net.sourceforge.pebble.Configuration:getSecurityRealm()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: PebbleUserDetails getUserDetails()
    //#    unanalyzed callee: SecurityRealm net.sourceforge.pebble.Configuration:getSecurityRealm()
    //#input(PebbleUserDetails getUserDetails()): log
    //#input(PebbleUserDetails getUserDetails()): net.sourceforge.pebble.PebbleContext__static_init.new PebbleContext(PebbleContext__static_init#1).__Tag
    //#input(PebbleUserDetails getUserDetails()): net.sourceforge.pebble.PebbleContext__static_init.new PebbleContext(PebbleContext__static_init#1).configuration
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/PebbleContext.__Descendant_Table[net/sourceforge/pebble/PebbleContext]
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/PebbleContext.__Dispatch_Table.getConfiguration()Lnet/sourceforge/pebble/Configuration;
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/PebbleContext.instance
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/DefaultSecurityRealm.__Descendant_Table[net/sourceforge/pebble/security/DefaultSecurityRealm]
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/DefaultSecurityRealm.__Descendant_Table[others]
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/DefaultSecurityRealm.__Dispatch_Table.getFileForRealm()Ljava/io/File;
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/DefaultSecurityRealm.__Dispatch_Table.getFileForUser(Ljava/lang/String;)Ljava/io/File;
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/DefaultSecurityRealm.__Dispatch_Table.getUser(Ljava/lang/String;)Lnet/sourceforge/pebble/security/PebbleUserDetails;
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/SecurityRealm.__Descendant_Table[net/sourceforge/pebble/security/DefaultSecurityRealm]
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/SecurityRealm.__Descendant_Table[net/sourceforge/pebble/security/SecurityRealm]
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/SecurityRealm.__Descendant_Table[others]
    //#input(PebbleUserDetails getUserDetails()): net/sourceforge/pebble/security/SecurityRealm.__Dispatch_Table.getUser(Ljava/lang/String;)Lnet/sourceforge/pebble/security/PebbleUserDetails;
    //#output(PebbleUserDetails getUserDetails()): new HashMap(PebbleUserDetails#1) num objects
    //#output(PebbleUserDetails getUserDetails()): new HashMap(getUser#3) num objects
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4) num objects
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).__Tag
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).detailsUpdateable
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).emailAddress
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).grantedAuthories
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).name
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).password
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).preferences
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).profile
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).username
    //#output(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).website
    //#output(PebbleUserDetails getUserDetails()): return_value
    //#new obj(PebbleUserDetails getUserDetails()): new HashMap(PebbleUserDetails#1)
    //#new obj(PebbleUserDetails getUserDetails()): new HashMap(getUser#3)
    //#new obj(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4)
    //#pre[1] (PebbleUserDetails getUserDetails()): (soft) net.sourceforge.pebble.PebbleContext__static_init.new PebbleContext(PebbleContext__static_init#1).configuration != null
    //#presumption(PebbleUserDetails getUserDetails()): net.sourceforge.pebble.Configuration:getSecurityRealm(...)@80 != null
    //#presumption(PebbleUserDetails getUserDetails()): org.apache.commons.logging.LogFactory:getLog(...)@62 != null
    //#presumption(PebbleUserDetails getUserDetails()): realm.__Tag@80 == net/sourceforge/pebble/security/DefaultSecurityRealm
    //#presumption(PebbleUserDetails getUserDetails()): realm.configuration@80 != null
    //#post(PebbleUserDetails getUserDetails()): return_value in Addr_Set{null,&new PebbleUserDetails(getUser#4)}
    //#post(PebbleUserDetails getUserDetails()): new HashMap(PebbleUserDetails#1) num objects <= 1
    //#post(PebbleUserDetails getUserDetails()): new HashMap(getUser#3) num objects <= 1
    //#post(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4) num objects <= 1
    //#post(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).__Tag == net/sourceforge/pebble/security/PebbleUserDetails
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).detailsUpdateable)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).emailAddress)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).grantedAuthories)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).name)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).password)
    //#post(PebbleUserDetails getUserDetails()): new PebbleUserDetails(getUser#4).preferences == &new HashMap(getUser#3)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).profile)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).username)
    //#post(PebbleUserDetails getUserDetails()): init'ed(new PebbleUserDetails(getUser#4).website)
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:net.sourceforge.pebble.Configuration:getDataDirectory
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.io.File
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:getFileForUser
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.io.File:exists
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.io.FileInputStream
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Properties
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.io.FileInputStream:close
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:split
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:equalsIgnoreCase
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.HashMap
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Properties:keySet
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:length
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Map:put
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.HashSet
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:org.acegisecurity.GrantedAuthorityImpl
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Set:add
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.util.Set:toArray
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:net.sourceforge.pebble.PebbleException
    //#unanalyzed(PebbleUserDetails getUserDetails()): Effects-of-calling:java.lang.String:valueOf
      return realm.getUser(getUsername());
    //#securityutils.java:81: Warning: method not available
    //#    -- call on PebbleUserDetails getUser(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: PebbleUserDetails getUserDetails()
    //#    unanalyzed callee: PebbleUserDetails getUser(String)
    } catch (SecurityRealmException e) {
      log.error("Exception encountered", e);
    //#securityutils.java:83: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: PebbleUserDetails getUserDetails()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
      return null;
    //#securityutils.java:84: end of method: PebbleUserDetails net.sourceforge.pebble.util.SecurityUtils.getUserDetails()
    }
  }

  public static boolean isUserInRole(String role) {
    SecurityContext ctx = SecurityContextHolder.getContext();
    //#securityutils.java:89: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserInRole(String)
    //#securityutils.java:89: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserInRole(String)
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#input(bool isUserInRole(String)): role
    //#output(bool isUserInRole(String)): return_value
    //#presumption(bool isUserInRole(String)): org.acegisecurity.context.SecurityContextHolder:getContext(...)@89 != null
    //#post(bool isUserInRole(String)): init'ed(return_value)
    //#unanalyzed(bool isUserInRole(String)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserInRole(String)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserInRole(String)): Effects-of-calling:java.lang.String:equals
    Authentication auth = ctx.getAuthentication();
    //#securityutils.java:90: Warning: method not available
    //#    -- call on Authentication org.acegisecurity.context.SecurityContext:getAuthentication()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserInRole(String)
    //#    unanalyzed callee: Authentication org.acegisecurity.context.SecurityContext:getAuthentication()
    return isUserInRole(auth, role);
    //#securityutils.java:91: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserInRole(String)
  }

  public static boolean isUserInRole(Authentication auth, String role) {
    if (auth != null) {
    //#securityutils.java:95: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserInRole(Authentication, String)
    //#input(bool isUserInRole(Authentication, String)): auth
    //#input(bool isUserInRole(Authentication, String)): role
    //#output(bool isUserInRole(Authentication, String)): return_value
    //#presumption(bool isUserInRole(Authentication, String)): Local_6[Local_4]@96 != null
    //#presumption(bool isUserInRole(Authentication, String)): authorities.length@96 <= 4_294_967_295
    //#presumption(bool isUserInRole(Authentication, String)): org.acegisecurity.GrantedAuthority:getAuthority(...)@99 != null
    //#post(bool isUserInRole(Authentication, String)): init'ed(return_value)
    //#test_vector(bool isUserInRole(Authentication, String)): auth: Addr_Set{null}, Inverse{null}
    //#test_vector(bool isUserInRole(Authentication, String)): java.lang.String:equals(...)@99: {0}, {1}
    //#test_vector(bool isUserInRole(Authentication, String)): org.acegisecurity.Authentication:getAuthorities(...)@96: Addr_Set{null}, Inverse{null}
      GrantedAuthority[] authorities = auth.getAuthorities();
    //#securityutils.java:96: Warning: method not available
    //#    -- call on GrantedAuthority[] org.acegisecurity.Authentication:getAuthorities()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserInRole(Authentication, String)
    //#    unanalyzed callee: GrantedAuthority[] org.acegisecurity.Authentication:getAuthorities()
      if (authorities != null) {
        for (GrantedAuthority authority : authorities) {
          if (authority.getAuthority().equals(role)) {
    //#securityutils.java:99: Warning: method not available
    //#    -- call on String org.acegisecurity.GrantedAuthority:getAuthority()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserInRole(Authentication, String)
    //#    unanalyzed callee: String org.acegisecurity.GrantedAuthority:getAuthority()
            return true;
          }
        }
      }
    }
    return false;
    //#securityutils.java:105: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserInRole(Authentication, String)
  }

  /**
   * Determines whether this user is a Pebble admin user.
   *
   * @return  true if the user is a Pebble admin, false otherwise
   */
  public static boolean isBlogAdmin() {
    return isUserInRole(Constants.BLOG_ADMIN_ROLE);
    //#securityutils.java:114: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogAdmin()
    //#input(bool isBlogAdmin()): net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE
    //#output(bool isBlogAdmin()): return_value
    //#presumption(bool isBlogAdmin()): init'ed(net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE)
    //#post(bool isBlogAdmin()): init'ed(return_value)
    //#unanalyzed(bool isBlogAdmin()): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isBlogAdmin()): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isBlogAdmin()): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogAdmin()): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogAdmin()): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:114: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogAdmin()
  }

  /**
   * Determines whether this user is a blog owner.
   *
   * @return  true if the user is a blog owner, false otherwise
   */
  public static boolean isBlogOwner() {
    return isUserInRole(Constants.BLOG_OWNER_ROLE);
    //#securityutils.java:123: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogOwner()
    //#input(bool isBlogOwner()): net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#output(bool isBlogOwner()): return_value
    //#presumption(bool isBlogOwner()): init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
    //#post(bool isBlogOwner()): init'ed(return_value)
    //#unanalyzed(bool isBlogOwner()): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isBlogOwner()): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isBlogOwner()): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogOwner()): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogOwner()): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:123: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogOwner()
  }

  /**
   * Determines whether this user is a blog publisher.
   *
   * @return  true if the user is a blog publisher, false otherwise
   */
  public static boolean isBlogPublisher() {
    return isUserInRole(Constants.BLOG_PUBLISHER_ROLE);
    //#securityutils.java:132: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogPublisher()
    //#input(bool isBlogPublisher()): net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE
    //#output(bool isBlogPublisher()): return_value
    //#presumption(bool isBlogPublisher()): init'ed(net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE)
    //#post(bool isBlogPublisher()): init'ed(return_value)
    //#unanalyzed(bool isBlogPublisher()): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isBlogPublisher()): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isBlogPublisher()): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogPublisher()): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogPublisher()): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:132: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogPublisher()
  }

  /**
   * Determines whether this user is a blog contributor.
   *
   * @return  true if the user is a blog contributor, false otherwise
   */
  public static boolean isBlogContributor() {
    return isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE);
    //#securityutils.java:141: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogContributor()
    //#input(bool isBlogContributor()): net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE
    //#output(bool isBlogContributor()): return_value
    //#presumption(bool isBlogContributor()): init'ed(net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE)
    //#post(bool isBlogContributor()): init'ed(return_value)
    //#unanalyzed(bool isBlogContributor()): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isBlogContributor()): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isBlogContributor()): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogContributor()): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogContributor()): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:141: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogContributor()
  }

  /**
   * Determines whether this user is a Pebble admin user.
   *
   * @return  true if the user is a Pebble admin, false otherwise
   */
  public static boolean isBlogAdmin(Authentication auth) {
    return isUserInRole(auth, Constants.BLOG_ADMIN_ROLE);
    //#securityutils.java:150: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogAdmin(Authentication)
    //#input(bool isBlogAdmin(Authentication)): auth
    //#input(bool isBlogAdmin(Authentication)): net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE
    //#output(bool isBlogAdmin(Authentication)): return_value
    //#presumption(bool isBlogAdmin(Authentication)): init'ed(net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE)
    //#post(bool isBlogAdmin(Authentication)): init'ed(return_value)
    //#unanalyzed(bool isBlogAdmin(Authentication)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogAdmin(Authentication)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogAdmin(Authentication)): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:150: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogAdmin(Authentication)
  }

  /**
   * Determines whether this user is a blog owner.
   *
   * @return  true if the user is a blog owner, false otherwise
   */
  public static boolean isBlogOwner(Authentication auth) {
    return isUserInRole(auth, Constants.BLOG_OWNER_ROLE);
    //#securityutils.java:159: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogOwner(Authentication)
    //#input(bool isBlogOwner(Authentication)): auth
    //#input(bool isBlogOwner(Authentication)): net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#output(bool isBlogOwner(Authentication)): return_value
    //#presumption(bool isBlogOwner(Authentication)): init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
    //#post(bool isBlogOwner(Authentication)): init'ed(return_value)
    //#unanalyzed(bool isBlogOwner(Authentication)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogOwner(Authentication)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogOwner(Authentication)): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:159: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogOwner(Authentication)
  }

  /**
   * Determines whether this user is a blog publisher.
   *
   * @return  true if the user is a blog publisher, false otherwise
   */
  public static boolean isBlogPublisher(Authentication auth) {
    return isUserInRole(auth, Constants.BLOG_PUBLISHER_ROLE);
    //#securityutils.java:168: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogPublisher(Authentication)
    //#input(bool isBlogPublisher(Authentication)): auth
    //#input(bool isBlogPublisher(Authentication)): net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE
    //#output(bool isBlogPublisher(Authentication)): return_value
    //#presumption(bool isBlogPublisher(Authentication)): init'ed(net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE)
    //#post(bool isBlogPublisher(Authentication)): init'ed(return_value)
    //#unanalyzed(bool isBlogPublisher(Authentication)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogPublisher(Authentication)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogPublisher(Authentication)): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:168: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogPublisher(Authentication)
  }

  /**
   * Determines whether this user is a blog contributor.
   *
   * @return  true if the user is a blog contributor, false otherwise
   */
  public static boolean isBlogContributor(Authentication auth) {
    return isUserInRole(auth, Constants.BLOG_CONTRIBUTOR_ROLE);
    //#securityutils.java:177: method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogContributor(Authentication)
    //#input(bool isBlogContributor(Authentication)): auth
    //#input(bool isBlogContributor(Authentication)): net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE
    //#output(bool isBlogContributor(Authentication)): return_value
    //#presumption(bool isBlogContributor(Authentication)): init'ed(net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE)
    //#post(bool isBlogContributor(Authentication)): init'ed(return_value)
    //#unanalyzed(bool isBlogContributor(Authentication)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isBlogContributor(Authentication)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isBlogContributor(Authentication)): Effects-of-calling:java.lang.String:equals
    //#securityutils.java:177: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isBlogContributor(Authentication)
  }

  public static void runAsBlogOwner() {
    Authentication auth = new TestingAuthenticationToken("username", "password", new GrantedAuthority[] {new GrantedAuthorityImpl(Constants.BLOG_OWNER_ROLE)});
    //#securityutils.java:181: method: void net.sourceforge.pebble.util.SecurityUtils.runAsBlogOwner()
    //#securityutils.java:181: Warning: method not available
    //#    -- call on void org.acegisecurity.GrantedAuthorityImpl(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogOwner()
    //#    unanalyzed callee: void org.acegisecurity.GrantedAuthorityImpl(String)
    //#securityutils.java:181: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogOwner()
    //#    unanalyzed callee: void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#input(void runAsBlogOwner()): net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#presumption(void runAsBlogOwner()): init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
    //#presumption(void runAsBlogOwner()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@182 != null
    SecurityContextHolder.getContext().setAuthentication(auth);
    //#securityutils.java:182: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogOwner()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#securityutils.java:182: Warning: method not available
    //#    -- call on void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogOwner()
    //#    unanalyzed callee: void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
  }
    //#securityutils.java:183: end of method: void net.sourceforge.pebble.util.SecurityUtils.runAsBlogOwner()

  public static void runAsBlogPublisher() {
    Authentication auth = new TestingAuthenticationToken("username", "password", new GrantedAuthority[] {new GrantedAuthorityImpl(Constants.BLOG_PUBLISHER_ROLE)});
    //#securityutils.java:186: method: void net.sourceforge.pebble.util.SecurityUtils.runAsBlogPublisher()
    //#securityutils.java:186: Warning: method not available
    //#    -- call on void org.acegisecurity.GrantedAuthorityImpl(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogPublisher()
    //#    unanalyzed callee: void org.acegisecurity.GrantedAuthorityImpl(String)
    //#securityutils.java:186: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogPublisher()
    //#    unanalyzed callee: void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#input(void runAsBlogPublisher()): net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE
    //#presumption(void runAsBlogPublisher()): init'ed(net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE)
    //#presumption(void runAsBlogPublisher()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@187 != null
    SecurityContextHolder.getContext().setAuthentication(auth);
    //#securityutils.java:187: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogPublisher()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#securityutils.java:187: Warning: method not available
    //#    -- call on void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogPublisher()
    //#    unanalyzed callee: void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
  }
    //#securityutils.java:188: end of method: void net.sourceforge.pebble.util.SecurityUtils.runAsBlogPublisher()

  public static void runAsBlogContributor() {
    Authentication auth = new TestingAuthenticationToken("username", "password", new GrantedAuthority[] {new GrantedAuthorityImpl(Constants.BLOG_CONTRIBUTOR_ROLE)});
    //#securityutils.java:191: method: void net.sourceforge.pebble.util.SecurityUtils.runAsBlogContributor()
    //#securityutils.java:191: Warning: method not available
    //#    -- call on void org.acegisecurity.GrantedAuthorityImpl(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogContributor()
    //#    unanalyzed callee: void org.acegisecurity.GrantedAuthorityImpl(String)
    //#securityutils.java:191: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogContributor()
    //#    unanalyzed callee: void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#input(void runAsBlogContributor()): net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE
    //#presumption(void runAsBlogContributor()): init'ed(net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE)
    //#presumption(void runAsBlogContributor()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@192 != null
    SecurityContextHolder.getContext().setAuthentication(auth);
    //#securityutils.java:192: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogContributor()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#securityutils.java:192: Warning: method not available
    //#    -- call on void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsBlogContributor()
    //#    unanalyzed callee: void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
  }
    //#securityutils.java:193: end of method: void net.sourceforge.pebble.util.SecurityUtils.runAsBlogContributor()

  public static void runAsAnonymous() {
    Authentication auth = new TestingAuthenticationToken("username", "password", new GrantedAuthority[] {});
    //#securityutils.java:196: method: void net.sourceforge.pebble.util.SecurityUtils.runAsAnonymous()
    //#securityutils.java:196: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsAnonymous()
    //#    unanalyzed callee: void org.acegisecurity.providers.TestingAuthenticationToken(Object, Object, GrantedAuthority[])
    //#presumption(void runAsAnonymous()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@197 != null
    SecurityContextHolder.getContext().setAuthentication(auth);
    //#securityutils.java:197: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsAnonymous()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#securityutils.java:197: Warning: method not available
    //#    -- call on void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsAnonymous()
    //#    unanalyzed callee: void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
  }
    //#securityutils.java:198: end of method: void net.sourceforge.pebble.util.SecurityUtils.runAsAnonymous()

  public static void runAsUnauthenticated() {
    SecurityContextHolder.getContext().setAuthentication(null);
    //#securityutils.java:201: method: void net.sourceforge.pebble.util.SecurityUtils.runAsUnauthenticated()
    //#securityutils.java:201: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsUnauthenticated()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#securityutils.java:201: Warning: method not available
    //#    -- call on void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void runAsUnauthenticated()
    //#    unanalyzed callee: void org.acegisecurity.context.SecurityContext:setAuthentication(Authentication)
    //#presumption(void runAsUnauthenticated()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@201 != null
  }
    //#securityutils.java:202: end of method: void net.sourceforge.pebble.util.SecurityUtils.runAsUnauthenticated()

  public static boolean isUserAuthorisedForBlogAsBlogOwner(Blog blog) {
    String currentUser = SecurityUtils.getUsername();
    //#securityutils.java:205: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogOwner(Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): return_value
    //#pre[1] (bool isUserAuthorisedForBlogAsBlogOwner(Blog)): (soft) blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): Effects-of-calling:java.lang.String:equals
    //#test_vector(bool isUserAuthorisedForBlogAsBlogOwner(Blog)): net.sourceforge.pebble.domain.Blog:isUserInRole(...)@206: {0}, {1}
    return isBlogOwner() && blog.isUserInRole(Constants.BLOG_OWNER_ROLE, currentUser);
    //#securityutils.java:206: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogOwner(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:206: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogOwner(Blog)
  }

  public static boolean isUserAuthorisedForBlogAsBlogPublisher(Blog blog) {
    String currentUser = SecurityUtils.getUsername();
    //#securityutils.java:210: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogPublisher(Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): return_value
    //#pre[1] (bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): (soft) blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): Effects-of-calling:java.lang.String:equals
    //#test_vector(bool isUserAuthorisedForBlogAsBlogPublisher(Blog)): net.sourceforge.pebble.domain.Blog:isUserInRole(...)@211: {0}, {1}
    return isBlogPublisher() && blog.isUserInRole(Constants.BLOG_PUBLISHER_ROLE, currentUser);
    //#securityutils.java:211: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogPublisher(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:211: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogPublisher(Blog)
  }

  public static boolean isUserAuthorisedForBlogAsBlogContributor(Blog blog) {
    String currentUser = SecurityUtils.getUsername();
    //#securityutils.java:215: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogContributor(Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): return_value
    //#pre[1] (bool isUserAuthorisedForBlogAsBlogContributor(Blog)): (soft) blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): Effects-of-calling:java.lang.String:equals
    //#test_vector(bool isUserAuthorisedForBlogAsBlogContributor(Blog)): net.sourceforge.pebble.domain.Blog:isUserInRole(...)@216: {0}, {1}
    return isBlogContributor() && blog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, currentUser);
    //#securityutils.java:216: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogContributor(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:216: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogContributor(Blog)
  }

  public static boolean isUserAuthorisedForBlogAsBlogOwner(Authentication auth, Blog blog) {
    String currentUser = SecurityUtils.getUsername(auth);
    //#securityutils.java:220: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): auth
    //#input(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): return_value
    //#pre[2] (bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): (soft) blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): Effects-of-calling:java.lang.String:equals
    //#test_vector(bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)): net.sourceforge.pebble.domain.Blog:isUserInRole(...)@221: {0}, {1}
    return isBlogOwner(auth) && blog.isUserInRole(Constants.BLOG_OWNER_ROLE, currentUser);
    //#securityutils.java:221: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:221: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogOwner(Authentication, Blog)
  }

  public static boolean isUserAuthorisedForBlogAsBlogPublisher(Authentication auth, Blog blog) {
    String currentUser = SecurityUtils.getUsername(auth);
    //#securityutils.java:225: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): auth
    //#input(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): return_value
    //#pre[2] (bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): (soft) blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_PUBLISHER_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): Effects-of-calling:java.lang.String:equals
    //#test_vector(bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)): net.sourceforge.pebble.domain.Blog:isUserInRole(...)@226: {0}, {1}
    return isBlogPublisher(auth) && blog.isUserInRole(Constants.BLOG_PUBLISHER_ROLE, currentUser);
    //#securityutils.java:226: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:226: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogPublisher(Authentication, Blog)
  }

  public static boolean isUserAuthorisedForBlogAsBlogContributor(Authentication auth, Blog blog) {
    String currentUser = SecurityUtils.getUsername(auth);
    //#securityutils.java:230: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): auth
    //#input(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): return_value
    //#pre[2] (bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): (soft) blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_CONTRIBUTOR_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): Effects-of-calling:java.lang.String:equals
    //#test_vector(bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)): net.sourceforge.pebble.domain.Blog:isUserInRole(...)@231: {0}, {1}
    return isBlogContributor(auth) && blog.isUserInRole(Constants.BLOG_CONTRIBUTOR_ROLE, currentUser);
    //#securityutils.java:231: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:231: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogContributor(Authentication, Blog)
  }

  public static boolean isUserAuthorisedForBlogAsBlogReader(Authentication auth, Blog blog) {
    String currentUser = SecurityUtils.getUsername(auth);
    //#securityutils.java:235: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)
    //#input(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): auth
    //#input(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): blog
    //#input(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): net.sourceforge.pebble.Constants.BLOG_READER_ROLE
    //#output(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): return_value
    //#pre[2] (bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): blog != null
    //#presumption(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): init'ed(net.sourceforge.pebble.Constants.BLOG_READER_ROLE)
    //#post(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    return blog.isUserInRole(Constants.BLOG_READER_ROLE, currentUser);
    //#securityutils.java:236: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Blog:isUserInRole(String, String)
    //#securityutils.java:236: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlogAsBlogReader(Authentication, Blog)
  }

  public static boolean isUserAuthorisedForBlog(Blog blog) {
    return isUserAuthorisedForBlogAsBlogOwner(blog) ||
    //#securityutils.java:240: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlog(Blog)
    //#input(bool isUserAuthorisedForBlog(Blog)): blog
    //#output(bool isUserAuthorisedForBlog(Blog)): return_value
    //#pre[1] (bool isUserAuthorisedForBlog(Blog)): (soft) blog != null
    //#post(bool isUserAuthorisedForBlog(Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContextHolder:getContext
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:org.acegisecurity.context.SecurityContext:getAuthentication
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(bool isUserAuthorisedForBlog(Blog)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:isUserInRole
        isUserAuthorisedForBlogAsBlogPublisher(blog) ||
        isUserAuthorisedForBlogAsBlogContributor(blog);
    //#securityutils.java:242: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlog(Blog)
  }

  public static boolean isUserAuthorisedForBlog(Authentication auth, Blog blog) {
    return isUserAuthorisedForBlogAsBlogOwner(auth, blog) ||
    //#securityutils.java:246: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlog(Authentication, Blog)
    //#input(bool isUserAuthorisedForBlog(Authentication, Blog)): auth
    //#input(bool isUserAuthorisedForBlog(Authentication, Blog)): blog
    //#output(bool isUserAuthorisedForBlog(Authentication, Blog)): return_value
    //#pre[2] (bool isUserAuthorisedForBlog(Authentication, Blog)): (soft) blog != null
    //#post(bool isUserAuthorisedForBlog(Authentication, Blog)): init'ed(return_value)
    //#unanalyzed(bool isUserAuthorisedForBlog(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getName
    //#unanalyzed(bool isUserAuthorisedForBlog(Authentication, Blog)): Effects-of-calling:org.acegisecurity.Authentication:getAuthorities
    //#unanalyzed(bool isUserAuthorisedForBlog(Authentication, Blog)): Effects-of-calling:org.acegisecurity.GrantedAuthority:getAuthority
    //#unanalyzed(bool isUserAuthorisedForBlog(Authentication, Blog)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(bool isUserAuthorisedForBlog(Authentication, Blog)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:isUserInRole
        isUserAuthorisedForBlogAsBlogPublisher(auth, blog) ||
        isUserAuthorisedForBlogAsBlogContributor(auth, blog);
    //#securityutils.java:248: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthorisedForBlog(Authentication, Blog)
  }

  public static boolean isUserAuthenticated() {
    SecurityContext ctx = SecurityContextHolder.getContext();
    //#securityutils.java:252: method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthenticated()
    //#securityutils.java:252: Warning: method not available
    //#    -- call on SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthenticated()
    //#    unanalyzed callee: SecurityContext org.acegisecurity.context.SecurityContextHolder:getContext()
    //#output(bool isUserAuthenticated()): return_value
    //#presumption(bool isUserAuthenticated()): org.acegisecurity.context.SecurityContextHolder:getContext(...)@252 != null
    //#post(bool isUserAuthenticated()): init'ed(return_value)
    //#test_vector(bool isUserAuthenticated()): org.acegisecurity.context.SecurityContext:getAuthentication(...)@253: Addr_Set{null}, Inverse{null}
    return ctx.getAuthentication() != null;
    //#securityutils.java:253: Warning: method not available
    //#    -- call on Authentication org.acegisecurity.context.SecurityContext:getAuthentication()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: bool isUserAuthenticated()
    //#    unanalyzed callee: Authentication org.acegisecurity.context.SecurityContext:getAuthentication()
    //#securityutils.java:253: end of method: bool net.sourceforge.pebble.util.SecurityUtils.isUserAuthenticated()
  }

  public static void main(String[] args) {
    if (args.length != 3) {
    //#securityutils.java:257: method: void net.sourceforge.pebble.util.SecurityUtils.main(String[])
    //#input(void main(String[])): args
    //#input(void main(String[])): args.length
    //#input(void main(String[])): args[0]
    //#input(void main(String[])): args[1]
    //#input(void main(String[])): args[2]
    //#input(void main(String[])): java.lang.System.out
    //#pre[1] (void main(String[])): args != null
    //#pre[3] (void main(String[])): (soft) args[0] != null
    //#pre[4] (void main(String[])): (soft) init'ed(args[1])
    //#pre[5] (void main(String[])): (soft) init'ed(args[2])
    //#presumption(void main(String[])): java.lang.System.out != null
    //#test_vector(void main(String[])): args.length: {3}, {0..2, 4..+Inf}
    //#test_vector(void main(String[])): java.lang.String:equals(...)@259: {0}, {1}
    //#test_vector(void main(String[])): java.lang.String:equals(...)@262: {0}, {1}
    //#test_vector(void main(String[])): java.lang.String:equals(...)@265: {0}, {1}
      System.out.println("Usage : [md5|sha|plaintext] username password");
    } else if (args[0].equals("md5")) {
      PasswordEncoder encoder = new Md5PasswordEncoder();
    //#securityutils.java:260: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.encoding.Md5PasswordEncoder()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void main(String[])
    //#    unanalyzed callee: void org.acegisecurity.providers.encoding.Md5PasswordEncoder()
      System.out.println(encoder.encodePassword(args[2], args[1]));
    //#securityutils.java:261: Warning: method not available
    //#    -- call on String org.acegisecurity.providers.encoding.PasswordEncoder:encodePassword(String, Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void main(String[])
    //#    unanalyzed callee: String org.acegisecurity.providers.encoding.PasswordEncoder:encodePassword(String, Object)
    } else if (args[0].equals("sha")) {
      PasswordEncoder encoder = new ShaPasswordEncoder();
    //#securityutils.java:263: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.encoding.ShaPasswordEncoder()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void main(String[])
    //#    unanalyzed callee: void org.acegisecurity.providers.encoding.ShaPasswordEncoder()
      System.out.println(encoder.encodePassword(args[2], args[1]));
    //#securityutils.java:264: Warning: method not available
    //#    -- call on String org.acegisecurity.providers.encoding.PasswordEncoder:encodePassword(String, Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void main(String[])
    //#    unanalyzed callee: String org.acegisecurity.providers.encoding.PasswordEncoder:encodePassword(String, Object)
    } else if (args[0].equals("plaintext")) {
      PasswordEncoder encoder = new PlaintextPasswordEncoder();
    //#securityutils.java:266: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.encoding.PlaintextPasswordEncoder()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void main(String[])
    //#    unanalyzed callee: void org.acegisecurity.providers.encoding.PlaintextPasswordEncoder()
      System.out.println(encoder.encodePassword(args[2], args[1]));
    //#securityutils.java:267: Warning: method not available
    //#    -- call on String org.acegisecurity.providers.encoding.PasswordEncoder:encodePassword(String, Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.SecurityUtils
    //#    method: void main(String[])
    //#    unanalyzed callee: String org.acegisecurity.providers.encoding.PasswordEncoder:encodePassword(String, Object)
    } else {
      System.out.println("Algorithm must be md5, sha or plaintext");
    }
  }
    //#securityutils.java:271: end of method: void net.sourceforge.pebble.util.SecurityUtils.main(String[])

}    //#securityutils.java:: end of class: net.sourceforge.pebble.util.SecurityUtils
