All Packages  This Package  Class Hierarchy  Class Search  Index

Class glguerin.authkit.imp.plain.DenyAllAuthorization
java.lang.Object
   |
   +----glguerin.authkit.Authorization
           |
           +----glguerin.authkit.imp.plain.DenyAllAuthorization

  Summary

public class  DenyAllAuthorization
     extends glguerin.authkit.Authorization
{
          // Constructors 1
     public DenyAllAuthorization();

          // Methods 13
     public void attach(byte[]);
     public void attachPrivileged();
     public void authorize(Privilege, boolean);
     public void detach(boolean);
     public Process execPrivileged(String[]);
     public int getCapabilities();
     public Date getPastGrantedDate(Privilege, int);
     public Enumeration getPastGrantedPrivileges();
     public byte[] getSecretIdentifier();
     public int getSecretLength();
     public boolean isAvailable(Privilege);
     public Privilege makeExecPrivilege(String);
     public void preauthorize(Privilege);
}

As its name implies, DenyAllAuthorization is an Authorization that denies all requests. Every call to authorize() or preauthorize() is always denied, throwing an UnauthorizedException. Every call to isAvailable() always returns false. This class is primarily for testing, since it doesn't allow any Privileges at all.

The implementation of DenyAllAuthorization uses only plain Java facilities, so it is entirely platform-neutral. Since no action is ever authorized, there isn't much else to say about it.




  Constructors

· DenyAllAuthorization

Summary  |  Top

   public DenyAllAuthorization() 

Create, unattached and unattachable.



  Methods

· getCapabilities

Summary  |  Top
   public int getCapabilities() 

Return zero: no special capabilities.

Overrides:
getCapabilities in class Authorization


· authorize

Summary  |  Top
   public void authorize(Privilege toGrant, 
                         boolean interactionAllowed) 

Always deny the Privilege by throwing an UnauthorizedException.

Throws: UnauthorizedException
thrown when the requested Privilege is not granted, i.e. always.
Overrides:
authorize in class Authorization


· preauthorize

Summary  |  Top
   public void preauthorize(Privilege toGrant) 

Always deny the Privilege by throwing an UnauthorizedException.

Throws: UnauthorizedException
thrown when the requested Privilege is not granted, i.e. always.
Overrides:
preauthorize in class Authorization


· isAvailable

Summary  |  Top
   public boolean isAvailable(Privilege toCheck) 

Is the given Privilege currently authorized or preauthorized?

Always returns false.

Overrides:
isAvailable in class Authorization


· detach

Summary  |  Top
   public void detach(boolean revokeShared) 

Detach the underlying session and all its granted authorizations, credentials, and rights.

This imp always returns without throwing an exception.

Overrides:
detach in class Authorization


· getPastGrantedPrivileges

Summary  |  Top
   public Enumeration getPastGrantedPrivileges() 

Return all past granted Privileges in an Enumeration.

This imp always returns an empty but non-null Enumeration, since no Privilege is ever granted.

Overrides:
getPastGrantedPrivileges in class Authorization


· getPastGrantedDate

Summary  |  Top
   public Date getPastGrantedDate(Privilege privilege, 
                                  int when) 

Return a timestamp Date for when Privilege was granted.

This imp always returns null, since no Privilege is ever granted.

Overrides:
getPastGrantedDate in class Authorization


· makeExecPrivilege

Summary  |  Top
   public Privilege makeExecPrivilege(String cmdName) 

Make and return a Privilege representing the right to execute a program as root.

This imp always returns a Privilege with the name "exec.root.denied" and a value of the cmdName. It won't work, but it's non-null and distinctive.

Overrides:
makeExecPrivilege in class Authorization


· execPrivileged

Summary  |  Top
   public Process execPrivileged(String[] progArray) 

Execute a program as root (run under root privileges). If the privilege is denied, an UnauthorizedException is thrown and no program is executed.

This imp always throws an UnauthorizedException.

Throws: UnauthorizedException
thrown when the necessary Privilege is not granted or preauthorized.
Throws: IllegalArgumentException
thrown when some malformation or structural error occurs.
Overrides:
execPrivileged in class Authorization


· getSecretLength

Summary  |  Top
   public int getSecretLength() 

Return the length of a buffer that can hold the secret session identifier.

This imp returns a buffer that's a different size than GrantAll or MacOSXAuthorization. This is partly to distinguish it, and partly so tests have to deal with different sizes.

Overrides:
getSecretLength in class Authorization


· getSecretIdentifier

Summary  |  Top
   public byte[] getSecretIdentifier() 

Return a secret identifier for this Authorization's current session.

This imp always throws an UnauthorizedException. I chose to do this rather than return a new byte[0] because it's more in line with the rest of this class's behavior.

Throws: UnauthorizedException
thrown when the session identifier cannot be externalized, i.e. always.
Overrides:
getSecretIdentifier in class Authorization


· attach

Summary  |  Top
   public void attach(byte[] secretIdentifier) 

Reconstitute the given secret externalized session ID, reconnecting (if possible) this Authorization to the underlying session. This Authorization must be newly constructed, or have just been detach()'d.

This imp always throws an UnauthorizedException, even if unattached.

Throws: UnauthorizedException
thrown when the session identifier cannot be internalized, i.e. always.
Overrides:
attach in class Authorization


· attachPrivileged

Summary  |  Top
   public void attachPrivileged() 

This imp always throws an UnauthorizedException, even if unattached.

Throws: UnauthorizedException
thrown when there is no privileged session to reconnect to, i.e. always.
Overrides:
attachPrivileged in class Authorization


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7