- java code: DatabaseRoleVoter
public class DatabaseRoleVoter implements AccessDecisionVoter
{
@Override
public
boolean supports(ConfigAttribute arg0) {
System.out.println(this.getClass().getName()
+
".supports(ConfigAttribute arg0)");
return
true;
}
@Override
public
boolean supports(Class arg0) {
System.out.println(this.getClass().getName() + ".supports(Class
arg0)");
return
true;
}
@Override
public int
vote(Authentication au, Object arg1, Collection arg2) {
int result =
0;
String name
= au.getName();
if
(name.equalsIgnoreCase("Rod")) {
result =
1;
} else
{
result =
-1;
}
System.out.println(this.getClass().getName() + ".vote");
System.out.println(arg1);
System.out.println(arg2);
return
result;
}
}
加载中,请稍候......