SK.gnome.dwarf.mail.auth
Class MailPermission

java.lang.Object
  extended byjava.security.Permission
      extended bySK.gnome.dwarf.mail.auth.MailPermission
All Implemented Interfaces:
java.security.Guard, java.io.Serializable

public final class MailPermission
extends java.security.Permission

Provides the mail permission.

Each mail permission is granted to a target mail folder. The permission name is full name of the target folder. It is OK to use wildcard character '*' as the last character of the name. In that case all folder names starting with the given string will be matched by this permission.

The permission action is represented by a string of characters - each single character represents a particular mail operation on the given folder:

The action characters are case insensitive and may be specified in any order. However, the empty string is not allowed as the action argument.

See Also:
Serialized Form

Constructor Summary
MailPermission(java.lang.String mailbox, java.lang.String actions)
          Creates a new MailPermission.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getActions()
          Returns the string of current actions.
 int hashCode()
           
 boolean impliedBy(MailPermission[] perms)
          Whether this permission is implied by the given permissions.
 boolean implies(java.security.Permission p)
          Whether this permission is implied by the given permission.
 void modifyActions(java.lang.String actions)
          Modifies the actions.
 java.lang.String toString()
           
 
Methods inherited from class java.security.Permission
getName, checkGuard, newPermissionCollection
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailPermission

public MailPermission(java.lang.String mailbox,
                      java.lang.String actions)
Creates a new MailPermission.

Parameters:
mailbox - the full folder name
actions - the action string
Method Detail

modifyActions

public void modifyActions(java.lang.String actions)
Modifies the actions.

The actions argument must be a string of characters. Each character represents a particular mail operation on the target folder. If the argument starts with '+' character, the actions are added to the current list of actions. If the argument starts with '-' character, the actions are removed from the current list of actions. If the argument is not prepended with any of these two characters, the current actions are replaced with the given ones.

Parameters:
actions - the actions

getActions

public java.lang.String getActions()
Returns the string of current actions.

Returns:
the actions

impliedBy

public boolean impliedBy(MailPermission[] perms)
Whether this permission is implied by the given permissions.

This permission is implied by the given permissions only if at least one of the array elements implies this permission.

Parameters:
perms - the array of mail permissions
Returns:
true if this permission is implied by the given array of permissions, false otherwise

implies

public boolean implies(java.security.Permission p)
Whether this permission is implied by the given permission.

Returns:
true if this permission is implied by the given permission, false otherwise

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.