All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ajanta.security.fileacl.FileAcl

java.lang.Object
   |
   +----ajanta.security.fileacl.FileAcl

public class FileAcl
extends Object
This class provides Access Control List for determining whether user has read and write permission for a given file.

See Also:
acl

Variable Index

 o fileAclTable
HashTable to maintain ACL entries
 o inherit
 o owner
Owner of the acl entries
 o ownerURN
Owner URN of the acl entries
 o read
 o rootPath
path to the root directory where .acl file can be obtained
 o urnPart
this is domain part of file URNs
 o write

Constructor Index

 o FileAcl(String)

Method Index

 o addFilePermission(URN, String, String)
Add file permission for a given user
 o checkFilePermission(URN, URN, String)
Check permission for a user
 o checkPermission(String, String, String)
Check permission for a user
 o checkPermission(URN, String, String)
Check permission for a user
 o checkPermission(URN, URN, String)
Check permission for a user
 o createAclEntry(String)
Create ACL entries : read for "r","write" for "w" and inherit for "i"
 o deleteFilePermission(URN, String, String)
delete file permission for a given user
 o initAclTable()
It reads .acl file under "root" directory and initializes the ACL table.

Variables

 o ownerURN
 protected URN ownerURN
Owner URN of the acl entries

 o rootPath
 protected String rootPath
path to the root directory where .acl file can be obtained

 o owner
 protected Principal owner
Owner of the acl entries

 o read
 protected Permission read
 o write
 protected Permission write
 o inherit
 protected Permission inherit
 o fileAclTable
 protected Hashtable fileAclTable
HashTable to maintain ACL entries

 o urnPart
 protected String urnPart
this is domain part of file URNs

Constructors

 o FileAcl
 public FileAcl(String root)
Parameters:
root - path to the root directory where .acl file can be obtained

Methods

 o initAclTable
 protected void initAclTable()
It reads .acl file under "root" directory and initializes the ACL table. An entry in .acl file can be
/home/grad25/rsingh/.ajanta/servers/calendarServer/HashTableDB rw URN:ans:fourier.cs.umn.edu/rsingh
name of the file "rwi" user1-URN user2-URN .....
r - read , w - write, i - inherit

 o createAclEntry
 protected void createAclEntry(String line)
Create ACL entries : read for "r","write" for "w" and inherit for "i"

 o deleteFilePermission
 public void deleteFilePermission(URN userURN,
                                  String fileName,
                                  String perm)
delete file permission for a given user

Parameters:
userURN - urn of the user who'e permission is being deleted
fileName - name of the file
perm - permission string "read","write" or "inherit"
 o addFilePermission
 public void addFilePermission(URN userURN,
                               String fileName,
                               String perm)
Add file permission for a given user

Parameters:
userURN - urn of the user who'e permission is being added
fileName - name of the file
perm - permission string "read","write" or "inherit"
 o checkFilePermission
 protected boolean checkFilePermission(URN userURN,
                                       URN fileName,
                                       String perm)
Check permission for a user

Parameters:
userURN - urn of the user
fileName - urn of the file ( urn:ans:root/somefile )
permission - string "read","write" or "inherit"
 o checkPermission
 public boolean checkPermission(String user,
                                String file,
                                String perm)
Check permission for a user

Parameters:
userURN - name of the user
fileName - name of the file ( root/somefile )
permission - string "read","write" or "inherit"
 o checkPermission
 public boolean checkPermission(URN userURN,
                                String file,
                                String perm)
Check permission for a user

Parameters:
userURN - urn of the user
fileName - name of the file ( root/somefile )
permission - string "read","write" or "inherit"
 o checkPermission
 public boolean checkPermission(URN userURN,
                                URN file,
                                String perm)
Check permission for a user

Parameters:
userURN - urn of the user
fileName - urn of the file ( urn:ans:root/somefile )
permission - string "read","write" or "inherit"

All Packages  Class Hierarchy  This Package  Previous  Next  Index