Dashboard Builder Security 6.1.0.Beta2

org.jboss.dashboard.security
Interface Policy

All Superinterfaces:
Persistent, Serializable

public interface Policy
extends Serializable, Persistent

Policy interface is a permissions manager and is used to grant permissions to subjects.


Method Summary
 void addPermission(Permission perm)
           
 void addPermission(Principal p, Permission perm)
           
 Permission getPermission(Principal prpal, Class permClass, String permName)
          Retrieve a permission.
 Map getPermissions(Object resource, Class permClass)
          Retrieve permissions assigned to the specified resource.
 PermissionCollection getPermissions(Principal prpal)
           
 PermissionCollection getPermissions(Subject user)
           
 void removePermission(Permission perm)
          Removes a permission attached to any principal.
 void removePermission(Principal p, Permission perm)
          Removes a permission granted to the specified principal.
 void removePermissions(Object resource)
           
 void removePermissions(Principal p, String resourceName)
          Removes all permission over a resource granted to a specified principal.
 void removePermissions(String resourceName)
          Removes all permission over a resource granted to any principal.
 
Methods inherited from interface org.jboss.dashboard.database.Persistent
delete, isPersistent, save, update
 

Method Detail

addPermission

void addPermission(Permission perm)

addPermission

void addPermission(Principal p,
                   Permission perm)

removePermissions

void removePermissions(Object resource)
                       throws Exception
Throws:
Exception

getPermissions

PermissionCollection getPermissions(Subject user)

getPermissions

PermissionCollection getPermissions(Principal prpal)

removePermission

void removePermission(Permission perm)
Removes a permission attached to any principal.


removePermission

void removePermission(Principal p,
                      Permission perm)
Removes a permission granted to the specified principal.

IMPORTANT NOTE: This policy implementation is based on java.security.PermissionCollection class. Due to the fact that PermissionCollection doesn't offer any method for remove added permissions, our removePermission implementation regenerates the full structure of permissions attached to the principal for all permissions but those 'implied' by the permission to be removed.


removePermissions

void removePermissions(String resourceName)
Removes all permission over a resource granted to any principal.


removePermissions

void removePermissions(Principal p,
                       String resourceName)
Removes all permission over a resource granted to a specified principal.


getPermissions

Map getPermissions(Object resource,
                   Class permClass)
                   throws Exception
Retrieve permissions assigned to the specified resource.

Parameters:
resource - The resource.
permClass - The permission class.
Returns:
A map containing the principal and the permission assigned to the resource for that principal.
Throws:
Exception

getPermission

Permission getPermission(Principal prpal,
                         Class permClass,
                         String permName)
Retrieve a permission.

Parameters:
prpal - The Principal for which the permission must be assigned.
permClass - The class type of the permission.
permName - The name of the permission.
Returns:

Dashboard Builder Security 6.1.0.Beta2

Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.