## org.mortbay.http
Interface UserPrincipal

All Superinterfaces:
  java.security.Principal

All Known Implementing Classes:
  JAASUserPrincipal, SecurityConstraint.Nobody

public interface UserPrincipal
extends java.security.Principal

User Principal. Extends the security principal with a method to check if the user is in a role.

Version:
  $Id: UserPrincipal.java,v 1.7 2002/05/07 14:29:18 gregwilkins Exp $
Author:
  Greg Wilkins (gregw)

Method Summary
`boolean` `isAuthenticated()` Check authentication status.
`boolean` `isUserInRole(java.lang.String role)` Check if the user is in a role.

Methods inherited from interface java.security.Principal
`equals, getName, hashCode, toString`

Method Detail

### isAuthenticated

    public boolean isAuthenticated()

  Check authentication status. Implementations of this method may adorn the calling context to assoicate it with the authenticated principal (eg ThreadLocals). If such context associations are made, they should be considered valid until a UserRealm.deAuthenticate(UserPrincipal) call is made for this UserPrincipal.

  Returns:
    True if this user is still authenticated.

### isUserInRole

    public boolean isUserInRole(java.lang.String role)

  Check if the user is in a role.

  Parameters:
    `role` - A role name.
  Returns:
    True if the user can act in that role.

Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.