1 7 package org.jboss.security.plugins; 8 9 import java.io.Serializable ; 10 import java.util.HashSet ; 11 import java.util.Set ; 12 import java.security.Principal ; 13 import javax.security.auth.Subject ; 14 15 import org.jboss.security.RealmMapping; 16 import org.jboss.security.SubjectSecurityManager; 17 import org.jboss.security.NobodyPrincipal; 18 19 20 30 public class NoAccessSecurityManager 31 implements SubjectSecurityManager, RealmMapping, Serializable 32 { 33 static final long serialVersionUID = -5922913661708382384L; 34 private String securityDomain; 35 36 39 public NoAccessSecurityManager(String securityDomain) 40 { 41 this.securityDomain = securityDomain; 42 } 43 44 47 public String getSecurityDomain() 48 { 49 return securityDomain; 50 } 51 54 public Subject getActiveSubject() 55 { 56 return null; 57 } 58 59 62 public boolean isValid(Principal principal, Object credential) 63 { 64 return false; 65 } 66 71 public boolean isValid(Principal principal, Object credential, 72 Subject activeSubject) 73 { 74 return false; 75 } 76 77 80 public Principal getPrincipal(Principal principal) 81 { 82 Principal result = principal; 83 return result; 84 } 85 86 92 public boolean doesUserHaveRole(Principal principal, Set roleNames) 93 { 94 boolean hasRole = false; 95 return hasRole; 96 } 97 98 101 public Set getUserRoles(Principal principal) 102 { 103 HashSet roles = new HashSet (); 104 roles.add(NobodyPrincipal.NOBODY_PRINCIPAL); 105 return roles; 106 } 107 108 113 private boolean authenticate(Principal principal, Object credential) 114 { 115 boolean authenticated = false; 116 return authenticated; 117 } 118 } 119 | Popular Tags |