org.benow.security.permission
Interface PermissionAdministrator


public interface PermissionAdministrator

security: org.benow.security.PermissionAdministrator

Author:
andy

Method Summary
 Permission createPermission(java.lang.Class prefix, java.lang.String suffix)
          Create a permission with the given prefix and suffix
 Role createRole(java.lang.String name, java.lang.String description)
          Create a new template, a named collection of permissions that can be used to initially provide permissions for a new user.
 Permission declarePermission(java.lang.Class prefix, java.lang.String suffix)
          Create a permission, indicating the permission is valid, remembered and can be enforced.
 java.lang.Class getPermissionClass()
          Gets the Class for permissions.
 Permission getPermissionFor(java.lang.String name)
          Gets the permission with the given name, throwing SecurityException if no named permission is found
 Permission getPermissionFor(java.lang.String name, java.lang.String value)
          Gets the permission with the given name and value, throwing SecurityException if no named permission is found
 Role getTemplate(java.lang.String name)
          Gets the declared permission template of the given name.
 java.lang.Class getTemplateClass()
          Gets the Class for templates.
 java.util.Collection getTemplates()
          Get all registered templates
 

Method Detail

getPermissionFor

Permission getPermissionFor(java.lang.String name)
                            throws java.lang.SecurityException
Gets the permission with the given name, throwing SecurityException if no named permission is found

Parameters:
name -
Returns:
Permission with given name
Throws:
java.lang.SecurityException

getPermissionFor

Permission getPermissionFor(java.lang.String name,
                            java.lang.String value)
                            throws java.lang.SecurityException
Gets the permission with the given name and value, throwing SecurityException if no named permission is found

Parameters:
name -
Returns:
Permission with given name
Throws:
java.lang.SecurityException

createPermission

Permission createPermission(java.lang.Class prefix,
                            java.lang.String suffix)
                            throws java.lang.SecurityException
Create a permission with the given prefix and suffix

Parameters:
prefix -
suffix -
Returns:
created permission
Throws:
java.lang.SecurityException

declarePermission

Permission declarePermission(java.lang.Class prefix,
                             java.lang.String suffix)
                             throws java.lang.SecurityException
Create a permission, indicating the permission is valid, remembered and can be enforced.

Parameters:
prefix -
suffix -
Returns:
created permission
Throws:
java.lang.SecurityException

getPermissionClass

java.lang.Class getPermissionClass()
Gets the Class for permissions.

Returns:
concrete type of permission being used
Throws:
java.lang.RuntimeException - if class has not been set.

getTemplates

java.util.Collection getTemplates()
Get all registered templates

Returns:
templates that have been registered

getTemplate

Role getTemplate(java.lang.String name)
                 throws java.lang.SecurityException
Gets the declared permission template of the given name. If no template is found, a SecurityException is thrown

Parameters:
name -
Returns:
permission template with given name
Throws:
java.lang.SecurityException

createRole

Role createRole(java.lang.String name,
                java.lang.String description)
                throws java.lang.SecurityException
Create a new template, a named collection of permissions that can be used to initially provide permissions for a new user.

Parameters:
name -
description -
Returns:
created role
Throws:
java.lang.SecurityException

getTemplateClass

java.lang.Class getTemplateClass()
Gets the Class for templates.

Returns:
type of template class being used.
Throws:
java.lang.RuntimeException - if class has not been set.