Name

Class java.security.Permission

Synopsis

This class forms the base class for all types of permissions that are used by the access controller. A permission object encapsulates a particular operation (e.g., reading the file /tmp/foo). It does not, however, grant permission for that operation; rather, the permission object is constructed and passed to the access controller to see if that operation is one which the current security policy has defined as a permissible operation.

Permissions have names (e.g., the name of the file, or the name of the operation) and may optionally have actions (the semantics of which are dependent upon the type of permission). It is up to the implies( ) method to determine if one permission grants another; this allows you to specify wildcard-type permissions that imply specific permissions (e.g., the permission named “*” may imply the permission named “myfile”).

Class Definition

public abstract class java.security.Permission
	extends java.lang.Object
	implements java.security.Guard, java.io.Serializable {

	// Constructors
	public Permission(String);

	// Instance Methods
	public void checkGuard(Object);
	public abstract boolean equals(Object);
	public abstract String getActions(  );
	public final String getName(  );
	public abstract int hashCode(  );
	public abstract boolean isReadOnly(  );
	public void setReadOnly(  );
	public PermissionCollection newPermissionCollection(  );
	public String toString(  );
}

See also

AccessController, AllPermission, BasicPermission, FilePermission, ...

Get Java Security, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.