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
-
checkPermission(Principal, Permission, File)
-
Determines if
user
has permission
for file
.
-
getAccessControl(File)
-
Gets existring permissions on
file
.
-
getAttributesPermission()
-
Specifies permission to check attributes such as whether a file
exists, is a file or directory, length, etc.
-
getDeletePermission()
-
Specifies permission to delete a file.
-
getExecutePermission()
-
Specifies permission to execute a file.
-
getListPermission()
-
Specifies permission to list a contents of a directory.
-
getReadPermission()
-
Specifies permission to read from a file.
-
getRenamePermission()
-
Specifies permission to rename a file.
-
getWritePermission()
-
Specifies permission to write to a file.
-
invalidateCache(File)
-
If ACL information for
file
is cached, invalidates it.
-
setAccessControl(Principal, File, Acl)
-
Replaces any existing permissions on
file
with
the new permissions in acl
.
-
setDefaultAccessControl(Principal, File)
-
Replaces any existing permissions on
file
with
the default permissions for newOwner
.
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.
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.
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
.
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.
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.
getAttributesPermission
public abstract Permission getAttributesPermission()
- Specifies permission to check attributes such as whether a file
exists, is a file or directory, length, etc.
getWritePermission
public abstract Permission getWritePermission()
- Specifies permission to write to a file.
getReadPermission
public abstract Permission getReadPermission()
- Specifies permission to read from a file.
getExecutePermission
public abstract Permission getExecutePermission()
- Specifies permission to execute a file.
getListPermission
public abstract Permission getListPermission()
- Specifies permission to list a contents of a directory.
getDeletePermission
public abstract Permission getDeletePermission()
- Specifies permission to delete a file.
getRenamePermission
public abstract Permission getRenamePermission()
- Specifies permission to rename a file.
All Packages Class Hierarchy This Package Previous Next Index