| java.lang.Object org.jboss.portal.security.impl.jacc.Permissions
Constructor Summary | |
public | Permissions() Creates a new Permissions object containing no PermissionCollections. |
Method Summary | |
public void | add(Permission permission) Adds a permission object to the PermissionCollection for the class the permission belongs to. | public boolean | implies(Permission permission) Checks to see if this object's PermissionCollection for permissions of the specified permission's type implies the
permissions expressed in the permission object. |
Permissions | public Permissions()(Code) | | Creates a new Permissions object containing no PermissionCollections.
|
add | public void add(Permission permission)(Code) | | Adds a permission object to the PermissionCollection for the class the permission belongs to. For example, if
permission is a FilePermission, it is added to the FilePermissionCollection stored in this Permissions
object.
This method creates a new PermissionCollection object (and adds the permission to it) if an appropriate collection
does not yet exist.
Parameters: permission - the Permission object to add. throws: SecurityException - if this Permissions object is marked as readonly. See Also: PermissionCollection.isReadOnly |
implies | public boolean implies(Permission permission)(Code) | | Checks to see if this object's PermissionCollection for permissions of the specified permission's type implies the
permissions expressed in the permission object. Returns true if the combination of permissions in the
appropriate PermissionCollection (e.g., a FilePermissionCollection for a FilePermission) together imply the
specified permission.
For example, suppose there is a FilePermissionCollection in this Permissions object, and it contains one
FilePermission that specifies "read" access for all files in all subdirectories of the "/tmp" directory, and
another FilePermission that specifies "write" access for all files in the "/tmp/scratch/foo" directory. Then if
the implies method is called with a permission specifying both "read" and "write" access to files in
the "/tmp/scratch/foo" directory, true is returned.
Additionally, if this PermissionCollection contains the AllPermission, this method will always return true.
Parameters: permission - the Permission object to check. true if "permission" is implied by the permissions in the PermissionCollection it belongs to, false ifnot. |
|
|