tyrex.security.container

Class RoleCredentials

public final class RoleCredentials extends Object

Credential listing the principal's roles. These credentials are used by the container to determine if a principal is member of a given role, and also return that information to the application.

Role credentials are considered public.

Version: $Revision: 1.5 $ $Date: 2001/03/19 17:39:02 $

Author: Assaf Arkin

Nested Class Summary
static classRoleCredentials.RoleEntry
Constructor Summary
RoleCredentials(String[] roleNames)
Construct a new credential with the given list of roles.
RoleCredentials(RoleCredentials[] creds)
Construct a new credential consolidating roles from a list of credentials.
Method Summary
voiddestroy()
Destroy the credentials.
booleanisDestroyed()
Returns true if these credentials have been destroyed.
booleanisInRole(String roleName)
Returns true if the principal is a member of the named role.
String[]listRoles()
Returns a list of all the role names.

Constructor Detail

RoleCredentials

public RoleCredentials(String[] roleNames)
Construct a new credential with the given list of roles.

Parameters: roleNames Array of zero or more roles

RoleCredentials

public RoleCredentials(RoleCredentials[] creds)
Construct a new credential consolidating roles from a list of credentials.

Parameters: creds Array of zero or more credentials

Method Detail

destroy

public void destroy()
Destroy the credentials.

isDestroyed

public boolean isDestroyed()
Returns true if these credentials have been destroyed.

isInRole

public boolean isInRole(String roleName)
Returns true if the principal is a member of the named role.

Parameters: roleName Role name

Returns: True if member of role

listRoles

public String[] listRoles()
Returns a list of all the role names.

Returns: Array of zero or more roles

Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.