ANTS v2.0 API

ants.core.security
Class BasicPolicy

java.lang.Object
  |
  +--ants.core.security.Policy
        |
        +--ants.core.security.BasicPolicy

public class BasicPolicy
extends Policy
implements java.io.Serializable

A hashtable-based implementation of a security policy that maps principals to permissions.

Author:
Andrew Whitaker
See Also:
Serialized Form

Constructor Summary
BasicPolicy()
          Creates a blank policy
 
Method Summary
 void addPermission(Principal who, Permission what)
          Add a permission after first checking for exact duplicates
 boolean hasPermission(Principal who, Permission what)
          Perform an access control check.
 void removePermission(Principal who, Permission what)
          Remove a permission from a given principal.
 void removePrincipal(Principal who)
          Remove all permissions for the given principal
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicPolicy

public BasicPolicy()
Creates a blank policy
Method Detail

hasPermission

public boolean hasPermission(Principal who,
                             Permission what)
Perform an access control check. This method uses the implies method of the Permission class, so "read write" implies the "read" permission.
Overrides:
hasPermission in class Policy
See Also:
Permission

addPermission

public void addPermission(Principal who,
                          Permission what)
Add a permission after first checking for exact duplicates
Overrides:
addPermission in class Policy

removePermission

public void removePermission(Principal who,
                             Permission what)
Remove a permission from a given principal. This method uses the equals method of the Permission class, so only exact matches are removed. That is, "read write" does not remove "read"
Overrides:
removePermission in class Policy

removePrincipal

public void removePrincipal(Principal who)
Remove all permissions for the given principal
Overrides:
removePrincipal in class Policy

ANTS v2.0 API

This documentation is Copyright (C) 1998-2001 The University of Utah and the University of Washington. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for ANTS v2.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/