org.benow.security.permission
Interface PermissionCheckable

All Known Subinterfaces:
PermissionGroup, User

public interface PermissionCheckable

Objects that can validate permissions should implement this interface.


Method Summary
 void checkPermission(Permission perm)
          checks to see if this role has the given permission.
 void checkPermission(java.lang.String name)
          Creates a default permission with the given name and checks for it's existence.
 void checkPermission(java.lang.String name, java.lang.String params)
          Creates a default permission with the given name and params and checks for it's existence.
 boolean hasPermission(java.lang.Class permissionPrefix, java.lang.String suffix)
           
 boolean hasPermission(Permission perm)
          Checks to see if the given permission has been granted.
 boolean hasPermission(java.lang.String name)
          Creates a new permission of the given name and returns it's existence.
 boolean hasPermission(java.lang.String name, java.lang.String params)
          Creates a new permission of the given name and params and returns it's existence.
 

Method Detail

checkPermission

void checkPermission(Permission perm)
                     throws java.lang.SecurityException
checks to see if this role has the given permission.

Parameters:
perm -
Throws:
java.lang.SecurityException - if not

checkPermission

void checkPermission(java.lang.String name)
                     throws java.lang.SecurityException
Creates a default permission with the given name and checks for it's existence.

Parameters:
name -
Throws:
java.lang.SecurityException - on permission check fail
See Also:
checkPermission(Permission)

checkPermission

void checkPermission(java.lang.String name,
                     java.lang.String params)
                     throws java.lang.SecurityException
Creates a default permission with the given name and params and checks for it's existence.

Parameters:
name -
params -
Throws:
java.lang.SecurityException - on permission check fail
See Also:
checkPermission(Permission)

hasPermission

boolean hasPermission(java.lang.String name)
Creates a new permission of the given name and returns it's existence.

Parameters:
name -
Returns:
true if permission granted, false otherwise
See Also:
hasPermission(Permission)

hasPermission

boolean hasPermission(java.lang.Class permissionPrefix,
                      java.lang.String suffix)

hasPermission

boolean hasPermission(java.lang.String name,
                      java.lang.String params)
Creates a new permission of the given name and params and returns it's existence.

Parameters:
name -
params -
Returns:
true if permission granted, false otherwise
See Also:
hasPermission(Permission)

hasPermission

boolean hasPermission(Permission perm)
Checks to see if the given permission has been granted.

Parameters:
perm -
Returns:
true if permission granted, false otherwise
See Also:
hasPermission(Permission)