com.cc.framework.security
Class RoleBasedPermission

java.lang.Object
  extended bycom.cc.framework.security.Permission
      extended bycom.cc.framework.security.RoleBasedPermission
All Implemented Interfaces:
java.io.Serializable

public class RoleBasedPermission
extends Permission

This class represents a role based permission

Since:
1.0
Version:
$Revision: 1.16 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
static java.lang.String INDICATOR
          INDICATOR
private  java.lang.String role
          The role
private static long serialVersionUID
          Serial Version UID
 
Fields inherited from class com.cc.framework.security.Permission
 
Constructor Summary
RoleBasedPermission(java.lang.String role)
          Constructor for RoleBasedPermission
RoleBasedPermission(java.lang.String role, java.lang.String message)
          Constructor for RoleBasedPermission
 
Method Summary
 boolean equals(java.lang.Object obj)
           
protected  java.lang.String getDefaultMessage()
          If no message is assigned to the permission this method returns a default message.
 boolean isGranted(Principal principal)
          Checks if the permission is granted.
 boolean isGranted(Principal principal, java.util.List notGranted)
          Checks if the permission is granted.
static Permission parse(java.lang.String permissionLiteral)
          Creates for the argument (role name) an Object of type Permission.
 java.lang.String toString()
           
 
Methods inherited from class com.cc.framework.security.Permission
getMessage, setMessage
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

INDICATOR

public static final java.lang.String INDICATOR
INDICATOR

See Also:
Constant Field Values

role

private java.lang.String role
The role

Constructor Detail

RoleBasedPermission

public RoleBasedPermission(java.lang.String role)
Constructor for RoleBasedPermission

Parameters:
role - The role

RoleBasedPermission

public RoleBasedPermission(java.lang.String role,
                           java.lang.String message)
Constructor for RoleBasedPermission

Parameters:
role - The role
message - A message assigned to the permission
Method Detail

parse

public static Permission parse(java.lang.String permissionLiteral)
                        throws PermissionException
Creates for the argument (role name) an Object of type Permission.

Parameters:
permissionLiteral - String to parse
Returns:
Permission or null
Throws:
PermissionException - if the argument is not matched

isGranted

public boolean isGranted(Principal principal)
Description copied from class: Permission
Checks if the permission is granted.

Specified by:
isGranted in class Permission
Parameters:
principal - Principal
Returns:
boolean
See Also:
Permission.isGranted(Principal)

isGranted

public boolean isGranted(Principal principal,
                         java.util.List notGranted)
Description copied from class: Permission
Checks if the permission is granted. Not granted permission will be added to the specified list.

Specified by:
isGranted in class Permission
Parameters:
principal - Principal
notGranted - List with Permission
Returns:
boolean
See Also:
Permission.isGranted(Principal, List)

getDefaultMessage

protected java.lang.String getDefaultMessage()
Description copied from class: Permission
If no message is assigned to the permission this method returns a default message.

Specified by:
getDefaultMessage in class Permission
Returns:
String
See Also:
Permission.getDefaultMessage()

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.