Openwings API Documentation (v1.1)

net.openwings.security
Class OpenwingsRole

java.lang.Object
  extended bynet.openwings.security.OpenwingsRole
All Implemented Interfaces:
java.security.Principal, java.io.Serializable

public class OpenwingsRole
extends java.lang.Object
implements java.security.Principal, java.io.Serializable

This interface represents the abstract notion of a user role. In the Openwings role-based access control model, each user may be assigned one or more Openwings roles, which are aggregated in a javax.security.auth.Subject.

Here is an example policy grant clause that grants permissions to users who have the Openwings role "administrator".

   grant Principal net.openwings.security.OpenwingsRole "administrator" {
     Permission java.io.FilePermission "c:\tmp", "read";
   };
 
.

See Also:
Serialized Form

Constructor Summary
OpenwingsRole(java.lang.String name)
          This constructs an Openwings role based on a role name.
 
Method Summary
 boolean equals(java.lang.Object another)
          This method overrides the default equals() implementation.
 java.lang.String getName()
          This method returns the name of the role.
 int hashCode()
          This method overrides the default hashCode() implementation.
 java.lang.String toString()
          This method overrides the default toString() implementation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenwingsRole

public OpenwingsRole(java.lang.String name)
This constructs an Openwings role based on a role name.

Parameters:
name - the name of the role
Method Detail

getName

public java.lang.String getName()
This method returns the name of the role.

Specified by:
getName in interface java.security.Principal

hashCode

public int hashCode()
This method overrides the default hashCode() implementation.

Specified by:
hashCode in interface java.security.Principal
Returns:
hash value

toString

public java.lang.String toString()
This method overrides the default toString() implementation.

Specified by:
toString in interface java.security.Principal
Returns:
role name

equals

public boolean equals(java.lang.Object another)
This method overrides the default equals() implementation.

Specified by:
equals in interface java.security.Principal
Parameters:
another - object to compare
Returns:
true if the object represents another OpenwingsRole with the same name.

Openwings API Documentation (v1.1)