Reformatting.

This commit is contained in:
Luke Taylor 2008-01-10 13:09:23 +00:00
parent 518ccada8c
commit 06c6c3b9f3
1 changed files with 51 additions and 58 deletions

View File

@ -22,13 +22,11 @@ import org.springframework.security.ConfigAttribute;
import org.springframework.security.ConfigAttributeDefinition; import org.springframework.security.ConfigAttributeDefinition;
/** /**
* <p>
* Votes if any {@link ConfigAttribute#getAttribute()} starts with a prefix * Votes if any {@link ConfigAttribute#getAttribute()} starts with a prefix
* indicating that it is a role. The default prefix string is <Code>ROLE_</code>, * indicating that it is a role. The default prefix string is <Code>ROLE_</code>,
* but this may be overriden to any value. It may also be set to empty, which * but this may be overriden to any value. It may also be set to empty, which
* means that essentially any attribute will be voted on. As described further * means that essentially any attribute will be voted on. As described further
* below, the effect of an empty prefix may not be quite desireable. * below, the effect of an empty prefix may not be quite desireable.
* </p>
* <p> * <p>
* Abstains from voting if no configuration attribute commences with the role * Abstains from voting if no configuration attribute commences with the role
* prefix. Votes to grant access if there is an exact matching * prefix. Votes to grant access if there is an exact matching
@ -36,7 +34,6 @@ import org.springframework.security.ConfigAttributeDefinition;
* starting with the role prefix. Votes to deny access if there is no exact * starting with the role prefix. Votes to deny access if there is no exact
* matching <code>GrantedAuthority</code> to a <code>ConfigAttribute</code> * matching <code>GrantedAuthority</code> to a <code>ConfigAttribute</code>
* starting with the role prefix. * starting with the role prefix.
* </p>
* <p> * <p>
* An empty role prefix means that the voter will vote for every * An empty role prefix means that the voter will vote for every
* ConfigAttribute. When there are different categories of ConfigAttributes * ConfigAttribute. When there are different categories of ConfigAttributes
@ -45,23 +42,19 @@ import org.springframework.security.ConfigAttributeDefinition;
* using preexisting role names without a prefix, and no ability exists to * using preexisting role names without a prefix, and no ability exists to
* prefix them with a role prefix on reading them in, such as provided for * prefix them with a role prefix on reading them in, such as provided for
* example in {@link org.springframework.security.userdetails.jdbc.JdbcDaoImpl}. * example in {@link org.springframework.security.userdetails.jdbc.JdbcDaoImpl}.
* </p>
* <p> * <p>
* All comparisons and prefixes are case sensitive. * All comparisons and prefixes are case sensitive.
* </p>
* *
* @author Ben Alex * @author Ben Alex
* @author colin sampaleanu * @author colin sampaleanu
* @version $Id$ * @version $Id$
*/ */
public class RoleVoter implements AccessDecisionVoter { public class RoleVoter implements AccessDecisionVoter {
// ~ Instance fields //~ Instance fields ================================================================================================
// ================================================================================================
private String rolePrefix = "ROLE_"; private String rolePrefix = "ROLE_";
// ~ Methods //~ Methods ========================================================================================================
// ========================================================================================================
public String getRolePrefix() { public String getRolePrefix() {
return rolePrefix; return rolePrefix;