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
-
fileAclTable
- HashTable to maintain ACL entries
-
inherit
-
-
owner
- Owner of the acl entries
-
ownerURN
- Owner URN of the acl entries
-
read
-
-
rootPath
- path to the root directory where .acl file can be obtained
-
urnPart
- this is domain part of file URNs
-
write
-
-
FileAcl(String)
-
-
addFilePermission(URN, String, String)
- Add file permission for a given user
-
checkFilePermission(URN, URN, String)
- Check permission for a user
-
checkPermission(String, String, String)
- Check permission for a user
-
checkPermission(URN, String, String)
- Check permission for a user
-
checkPermission(URN, URN, String)
- Check permission for a user
-
createAclEntry(String)
- Create ACL entries : read for "r","write" for "w" and inherit for "i"
-
deleteFilePermission(URN, String, String)
- delete file permission for a given user
-
initAclTable()
-
It reads .acl file under "root" directory and initializes the ACL table.
ownerURN
protected URN ownerURN
- Owner URN of the acl entries
rootPath
protected String rootPath
- path to the root directory where .acl file can be obtained
owner
protected Principal owner
- Owner of the acl entries
read
protected Permission read
write
protected Permission write
inherit
protected Permission inherit
fileAclTable
protected Hashtable fileAclTable
- HashTable to maintain ACL entries
urnPart
protected String urnPart
- this is domain part of file URNs
FileAcl
public FileAcl(String root)
- Parameters:
- root - path to the root directory where .acl file can be obtained
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
createAclEntry
protected void createAclEntry(String line)
- Create ACL entries : read for "r","write" for "w" and inherit for "i"
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"
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"
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"
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"
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"
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