## org.jboss.security
Interface RealmMapping

All Known Subinterfaces:
  SecurityDomain

All Known Implementing Classes:
  NullSecurityManager

public interface RealmMapping

The interface for Principal mapping. It defines the mapping from the operational environment Principal to the application domain principal via the `getPrincipal` method. It also defines the method for validating the application domain roles to which the operational environment Principal belongs via the `getPrincipal` method.

Version:
  $Revision: 1.3.2.2 $
Author:
  Scott.Stark@jboss.org

Method Summary
`boolean` `doesUserHaveRole(java.security.Principal principal, java.util.Set roles)` Validates the application domain roles to which the operational environment Principal belongs.
`java.security.Principal` `getPrincipal(java.security.Principal principal)` Map from the operational environment Principal to the application domain principal.
`java.util.Set` `getUserRoles(java.security.Principal principal)` Return the set of domain roles the principal has been assigned.

Method Detail

### getPrincipal

    public java.security.Principal getPrincipal(java.security.Principal principal)

  Map from the operational environment Principal to the application domain principal. This is used by the EJBContext.getCallerPrincipal implentation to map from the authenticated principal to a principal in the application domain.
  Parameters:
    `principal,` - the caller principal as known in the operation environment.
  Returns:
    the principal

### doesUserHaveRole

    public boolean doesUserHaveRole(java.security.Principal principal,
                                    java.util.Set roles)

  Validates the application domain roles to which the operational environment Principal belongs.
  Parameters:
    `principal,` - the caller principal as known in the operation environment.
    `The` - Set<Principal> for the application domain roles that the principal is to be validated against.
  Returns:
    true if the principal has at least one of the roles in the roles set, false otherwise.

### getUserRoles

    public java.util.Set getUserRoles(java.security.Principal principal)

  Return the set of domain roles the principal has been assigned.
  Returns:
    The Set<Principal> for the application domain roles that the principal has been assigned.

Copyright © 2000 The JBoss Organization. All Rights Reserved.