org.benow.security.permission
Interface Permission


public interface Permission

A permission is belongs to a role which a user has. If the user has a role which contains a permission, the user is allow to perform actions which require that permission.

Permissions are declared within a class, usually via @link org.benow.security.SecurityAdministrator#createPermission(Class, String)


Nested Class Summary
static interface Permission.AnonymousAccess
          Annotation to indicate that Anonymous users can invoke specific methods.
static interface Permission.AnyUserAccess
          Annotation to indicate that any user can invoke the method.
static interface Permission.RequiresPermission
          Indicates that a method requires a certain permission to be executed/discovered.
static interface Permission.RestrictOnField
          Field within a param that is used to identify a restriction.
 
Method Summary
 void assertPermission()
          Assert this permission, throwing security exception if no permission.
 java.lang.Class getDeclarator()
          Gets the class in which this permission is declared.
 java.lang.String getDescription()
           
 java.lang.String getName()
          Gets the name of this permission
 java.lang.String getParams()
          gets the params for this permission (if any)
 java.util.Collection<Role> getRoles()
          gets the roles which contain this permission
 boolean hasPermission()
          Does the current user have this permission?
 void setParams(java.lang.String params)
          sets the params for this permission
 

Method Detail

getDeclarator

java.lang.Class getDeclarator()
Gets the class in which this permission is declared.

Returns:
class in which this permission is declared

getName

java.lang.String getName()
Gets the name of this permission

Returns:
name of this permission

getDescription

java.lang.String getDescription()

getRoles

java.util.Collection<Role> getRoles()
gets the roles which contain this permission

Returns:
roles containing this permission

getParams

java.lang.String getParams()
gets the params for this permission (if any)

Returns:
params for this permission

setParams

void setParams(java.lang.String params)
sets the params for this permission

Parameters:
params -

assertPermission

void assertPermission()
                      throws java.lang.SecurityException
Assert this permission, throwing security exception if no permission.

Throws:
java.lang.SecurityException

hasPermission

boolean hasPermission()
Does the current user have this permission?

Returns: