All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jnfs.security.PermissionGranter

public interface interface PermissionGranter
A permission granter lets the filesystem check if a particular Principal should have some permission for a file. A little like a SecurityManager, but only for files.

Version:
$Id: PermissionGranter.java,v 1.20 1997/05/20 19:16:20 mjr Exp $
Author:
Michael John Radwin

Method Index

 o checkPermission(Principal, Permission, File)
Determines if user has permission for file.
 o getAccessControl(File)
Gets existring permissions on file.
 o getAttributesPermission()
Specifies permission to check attributes such as whether a file exists, is a file or directory, length, etc.
 o getDeletePermission()
Specifies permission to delete a file.
 o getExecutePermission()
Specifies permission to execute a file.
 o getListPermission()
Specifies permission to list a contents of a directory.
 o getReadPermission()
Specifies permission to read from a file.
 o getRenamePermission()
Specifies permission to rename a file.
 o getWritePermission()
Specifies permission to write to a file.
 o invalidateCache(File)
If ACL information for file is cached, invalidates it.
 o setAccessControl(Principal, File, Acl)
Replaces any existing permissions on file with the new permissions in acl.
 o setDefaultAccessControl(Principal, File)
Replaces any existing permissions on file with the default permissions for newOwner.

Methods

 o checkPermission
 public abstract boolean checkPermission(Principal user,
                                         Permission permission,
                                         File file) throws IOException
Determines if user has permission for file.

Returns:
true if user has the specified permission; false otherwise.
Throws: IOException
if an I/O error occurs.
 o getAccessControl
 public abstract Acl getAccessControl(File file) throws IOException
Gets existring permissions on file. Permissions on a particular file don't necessarily map 1-to-1 to who can access the file or not because there may be security restrictions on the parent directories of the file that override this file's settings.

Returns:
the ACL for this file if the user can see it; null otherwise.
Throws: IOException
if an I/O error occurs.
 o setAccessControl
 public abstract boolean setAccessControl(Principal user,
                                          File file,
                                          Acl acl) throws IOException, NotOwnerException
Replaces any existing permissions on file with the new permissions in acl.

Returns:
true if the permissions were set; false otherwise.
Throws: IOException
if an I/O error occurs.
Throws: NotOwnerException
if user is not an owner of file.
 o setDefaultAccessControl
 public abstract boolean setDefaultAccessControl(Principal newOwner,
                                                 File file) throws IOException
Replaces any existing permissions on file with the default permissions for newOwner. Changes the ownership to the new owner.

Returns:
true if the permissions were set; false otherwise.
Throws: IOException
if an I/O error occurs.
 o invalidateCache
 public abstract boolean invalidateCache(File file)
If ACL information for file is cached, invalidates it.

Returns:
true if the ACL information was in the cache; false otherwise.
 o getAttributesPermission
 public abstract Permission getAttributesPermission()
Specifies permission to check attributes such as whether a file exists, is a file or directory, length, etc.

 o getWritePermission
 public abstract Permission getWritePermission()
Specifies permission to write to a file.

 o getReadPermission
 public abstract Permission getReadPermission()
Specifies permission to read from a file.

 o getExecutePermission
 public abstract Permission getExecutePermission()
Specifies permission to execute a file.

 o getListPermission
 public abstract Permission getListPermission()
Specifies permission to list a contents of a directory.

 o getDeletePermission
 public abstract Permission getDeletePermission()
Specifies permission to delete a file.

 o getRenamePermission
 public abstract Permission getRenamePermission()
Specifies permission to rename a file.


All Packages  Class Hierarchy  This Package  Previous  Next  Index