com.cc.framework.security
Class FunctionBasedPermission

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

public class FunctionBasedPermission
extends Permission

This class represents a permission for a function in the application

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

Field Summary
private  java.lang.String function
          Function
static java.lang.String INDICATOR
          INDICATOR
private static long serialVersionUID
          Serial Version UID
 
Fields inherited from class com.cc.framework.security.Permission
 
Constructor Summary
FunctionBasedPermission(java.lang.String function)
          Constructor for FunctionBasedPermission
FunctionBasedPermission(java.lang.String function, java.lang.String message)
          Constructor for FunctionBasedPermission
 
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.
 java.lang.String getFunction()
          Returns the function name
 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 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

function

private java.lang.String function
Function

Constructor Detail

FunctionBasedPermission

public FunctionBasedPermission(java.lang.String function)
Constructor for FunctionBasedPermission

Parameters:
function - the name of the function

FunctionBasedPermission

public FunctionBasedPermission(java.lang.String function,
                               java.lang.String message)
Constructor for FunctionBasedPermission

Parameters:
function - the name of the function
message - a message assigned to the permission
Method Detail

getFunction

public java.lang.String getFunction()
Returns the function name

Returns:
String

parse

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

Legal Values:

Parameters:
permissionLiteral - String to parse
Returns:
Permission
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.