WebRoleRefPermission (Java EE 5)

Java EE API


javax.security.jacc Class WebRoleRefPermission

java.lang.Object
  extended by java.security.Permission
      extended by javax.security.jacc.WebRoleRefPermission
All Implemented Interfaces:
Serializable, Guard

public final class WebRoleRefPermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

Servlet isUserInRole (String reference) 权限的类。WebRoleRefPermission 是一种指定权限,它包含各种操作。

WebRoleRefPermission 的名称(也称为目标名称)按 servlet 名称标识 Web 资源(在部署描述符中,servlet 名称对应于从中调用 isUserInRole (String reference) 的组件)。

WebRoleRefPermission 的操作标识应用权限的角色引用。检查 WebRoleRefPermission 确定主体是否是引用所标识的角色的成员。

此类的实现可以实现 newPermissionCollection,也可以从超类继承其实现。

英文文档:

Class for Servlet isUserInRole (String reference) permissions. A WebRoleRefPermission is a named permission and has actions.

The name of an WebRoleRefPermission (also referred to as the target name) identifies a Web resource by the servlet name (in the deployment descriptor corresponding to the component from which the call to isUserInRole (String reference) is being made.

The actions of an WebRoleRefPermission identifies the role reference to which the permission applies. A WebRoleRefPermission is checked to determine if the subject is a member of the role identified by the reference.

Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
 
Method Summary
 boolean
 String
 int
 boolean
 
Methods inherited from class java.security.Permission
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public WebRoleRefPermission(String name, String actions)
创建具有指定名称和操作创建的新 WebRoleRefPermission。

name 标识在其上下文中求角色引用值的特定于应用程序的 Web 资源的 servlet 名称。

actions 标识应用权限的角色引用。角色引用的范围限定为名称参数标识的 Web 资源。角色引用的值不得为 null 或空字符串。

英文文档:

WebRoleRefPermission

public WebRoleRefPermission(String name,
                            String actions)
Creates a new WebRoleRefPermission with the specified name and actions.

Parameters:
name - the servlet-name that identifies the application specific web resource in whose context the role references are to be evaluated.

actions - identifies the role reference to which the permission pertains. The role reference is scoped to the Web resource identified in the name parameter. The value of the role reference must not be null or the empty string.

Method Detail

public boolean equals(Object o)
检查两个 WebRoleRefPermission 对象是否相等。如果 WebRoleRefPermission 对象有相同的名称和操作值(区分大小写),则它们相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时,这两个 Permission 对象(P1 和 P2)才是相等的。

上述名称和操作比较是区分大小写的。

o 要测试是否与此 WebRoleRefPermission 相等的 WebRoleRefPermission 对象
return 如果参数 EJBRoleRefPermission 对象与此 EJBRoleRefPermission 相等,则返回 true。

英文文档:

equals

public boolean equals(Object o)
Checks two WebRoleRefPermission objects for equality. WebRoleRefPermission objects are equivalent if they have case equivalent name and actions values.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

The name and actions comparisons described above are case sensitive.

Specified by:
equals in class Permission
Parameters:
o - the WebRoleRefPermission object being tested for equality with this WebRoleRefPermission.
Returns:
true if the argument WebRoleRefPermission object is equivalent to this WebRoleRefPermission.

public String getActions()
返回此 WebRoleRefPermission 的操作的规范字符串表示形式。

return 包含此 WebRoleRefPermission 的规范操作的字符串。

英文文档:

getActions

public String getActions()
Returns a canonical String representation of the actions of this WebRoleRefPermission.

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this WebRoleRefPermission.

public int hashCode()
返回此 WebRoleRefPermission 的哈希码值。所返回哈希码的属性必须如下所示:

  • 在 Java 应用程序的生命周期中,每次对 WebRoleRefPermission 对象调用 hashCode 方法时,该方法都必须返回相同的整数值。应用程序每次对特定 WebRoleRefPermission 执行 hashCode 所返回的值不必总是相同。
  • 如果根据 equals 方法,两个 WebRoleRefPermission 对象相等,那么对这两个 Permission 对象调用 hashCode 方法必须生成相同的整数结果(在应用程序内)。

return 此对象的整数哈希码值。

英文文档:

hashCode

public int hashCode()
Returns the hash code value for this WebRoleRefPermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a WebRoleRefPermission object. The value returned by hashCode for a particular WebRoleRefPermission need not remain consistent from one execution of an application to another.
  • If two WebRoleRefPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 WebRoleRefPermission 是否“隐含”参数 Permission。如果是这样,

  • 参数必须是 WebRoleRefPermission 的实例,
  • 名称等于此 WebRoleRefPermission,且
  • 角色引用等于此 WebRoleRefPermission(在其操作中定义)。

上述比较都是区分大小写的。

permission 检查是否隐含参数权限的 "this" WebRoleRefPermission。

return 如果对象隐含指定的权限,则返回 true;否则返回 false。

英文文档:

implies

public boolean implies(Permission permission)
Determines if the argument Permission is "implied by" this WebRoleRefPermission. For this to be the case,

  • The argument must be an instanceof WebRoleRefPermission
  • with name equivalent to this WebRoleRefPermission, and
  • with role reference equivalent to this WebRoleRefPermission (as defined in their actions).

The comparisons described above are case sensitive.

Specified by:
implies in class Permission
Parameters:
permission - "this" WebRoleRefPermission is checked to see if it implies the argument permission.

Returns:
true if the specified permission is implied by this object, false if not.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!