1 26 27 package org.objectweb.jonas.security.realm.web.jetty50; 28 29 import java.security.Principal ; 30 import java.util.ArrayList ; 31 32 36 public class JettyPrincipal implements Principal { 37 38 41 private String name; 42 43 46 private ArrayList roles; 47 48 53 public JettyPrincipal(String name, ArrayList roles) { 54 this.name = name; 55 this.roles = roles; 56 } 57 58 62 public String getName() { 63 return name; 64 } 65 66 70 public boolean isAuthenticated() { 71 return true; 72 } 73 74 79 public boolean isUserInRole(String role) { 80 if (roles == null) { 81 return (false); 82 } 83 return roles.contains(role); 84 } 85 86 90 public ArrayList getRoles() { 91 return roles; 92 } 93 94 } | Popular Tags |