jpl.mipl.mdms.FileService.komodo.fileMgmt
Class UserProfile

java.lang.Object
  |
  +--jpl.mipl.mdms.FileService.komodo.fileMgmt.UserProfile

public class UserProfile
extends Object

Contains access information for file types, super-user and admin roles. As of S5, access is bye read all, write all, admin. There is no access control on a fileType by fileType basis. Therefore, regular users (type 0) have no access.

Version:
$Id: UserProfile.java,v 1.2 2003/02/19 01:00:34 txh Exp $
Author:
jdj

Constructor Summary
UserProfile(FileMgrDBMS dbmsAccess, String name, String password)
          Constructor
 
Method Summary
 boolean add(int ftId)
          Method to return true if user has add access to the input file type
 boolean archive(int ftId)
          Method to return true if the user has update get access to this type.
 boolean confirm(int ftId)
          Method to return true if the user have confirm transfer access
 boolean delete(int ftId)
          Method to return true if the user have delete access to this type
 boolean get(int ftId)
          Method to return true if the user have get access to this type
 String getFtCapListStr()
          Accessor to the file type capabilities list string.
 String getName()
          Accessor method to return user name
 int getUserAccess()
          Access or method to return the user access mask
 int getUserId()
          Accessor method to return user id
 String getVFTCapListStr()
          Accessor method to the vft capabilities list string.
 boolean gotCapability(int ftId, int mask)
          Method to return true of false if a user has a particular capability.
 boolean isAdmin()
          Method to return true if the user have admin privs
 boolean isVFT()
          Method to return true if this user have vft admin.
 boolean lockType(int ftId)
          Method to return true if user have lock file type access
 boolean receipt(int ftId)
          Method to return true if the user have receipt for this type
Note: write_all does not automatically get this.
 boolean rename(int ftId)
          Method to return true if the user have rename to this type
 boolean replace(int ftId)
          Method to return true if the user have replace access to this type
 void setFtCapabilities(Hashtable ftCapabilities)
          Method to set file type capabilities lookup table.
 void setFtCapListStr(String ftCapListStr)
          Method to set the file type capabilities string.
 boolean setSuperUser()
          Method to return true if user can set super user
 boolean setuid(int ftId)
          Method to return true if this user can setuid
 void setUserId(int userId)
          Method to set user id.
 void setVFT(boolean vft)
          Method to set the user vft flag.
 void setVFTCapabilities(Hashtable vftCapabilities)
          Method to set vft capabilities lookup table.
 void setVFTCapListStr(String vftCapListStr)
          Method to set the vft capabilities list string.
 boolean subtype(int ftId)
          Method to return true if the user have create subtype access
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserProfile

public UserProfile(FileMgrDBMS dbmsAccess,
                   String name,
                   String password)
            throws IllegalArgumentException,
                   Exception
Constructor

Parameters:
dbmsAccess - reference to the DBMS access object
name - the user name
password - the user password
Throws:
IllegalArgumentException - when invalid input values
Exception - general operation failure
Method Detail

add

public boolean add(int ftId)
Method to return true if user has add access to the input file type

Parameters:
ftId - the file type id
Returns:
true if user has add access

archive

public boolean archive(int ftId)
Method to return true if the user has update get access to this type.

Parameters:
ftId - the file type id
Returns:
true if user has update get access

confirm

public boolean confirm(int ftId)
Method to return true if the user have confirm transfer access

Parameters:
ftId - the file type id
Returns:
true if user has confirm transfer access

delete

public boolean delete(int ftId)
Method to return true if the user have delete access to this type

Parameters:
ftId - the file type id
Returns:
true if user as delete access

get

public boolean get(int ftId)
Method to return true if the user have get access to this type

Parameters:
ftId - the file type id
Returns:
true if user have get access

lockType

public boolean lockType(int ftId)
Method to return true if user have lock file type access

Parameters:
ftId - the file type id
Returns:
true if user has lock file type access

replace

public boolean replace(int ftId)
Method to return true if the user have replace access to this type

Parameters:
ftId - the file type id
Returns:
true if the user have replace access

receipt

public boolean receipt(int ftId)
Method to return true if the user have receipt for this type
Note: write_all does not automatically get this.

Parameters:
ftId - the file type id
Returns:
true if user has receipt for this file type

rename

public boolean rename(int ftId)
Method to return true if the user have rename to this type

Parameters:
ftId - the file type id
Returns:
true if the user has rename access

subtype

public boolean subtype(int ftId)
Method to return true if the user have create subtype access

Parameters:
ftId - the file type id
Returns:
true if the user has create subtype access

getUserAccess

public int getUserAccess()
Access or method to return the user access mask

Returns:
the user access mask

getUserId

public int getUserId()
Accessor method to return user id

Returns:
user id

setUserId

public void setUserId(int userId)
Method to set user id.

Parameters:
userId - the user id.

getName

public String getName()
Accessor method to return user name

Returns:
user name

setVFTCapabilities

public void setVFTCapabilities(Hashtable vftCapabilities)
Method to set vft capabilities lookup table.

Parameters:
vftCapabilities - the input vft capabilities.

setFtCapabilities

public void setFtCapabilities(Hashtable ftCapabilities)
Method to set file type capabilities lookup table.

Parameters:
ftCapabilities - input file type capabilities lookup table.

gotCapability

public boolean gotCapability(int ftId,
                             int mask)
Method to return true of false if a user has a particular capability. Note: If the policy for capabilities is such that some capabilities imply others, such as replace implies (add, get, show, etc), then the dbms must set additional bits in the mask based on those rules. No interpretation of capability masks is done here for two reasons.
  1. Efficiency of the code (no if then else stuff).
  2. All access rules come from KomodoDB, instead of any hard-coded rule derivations, the DBMS must set the "GET" capability of the intention is "ADD" implies "GET".

Parameters:
ftId - the file type id
mask - the capability mask
Returns:
true if user has the input capabilities for the given file type

setuid

public boolean setuid(int ftId)
Method to return true if this user can setuid

Parameters:
ftId - the file type id
Returns:
true if the user can setuid

setSuperUser

public boolean setSuperUser()
Method to return true if user can set super user

Returns:
true if user can set super user

isAdmin

public boolean isAdmin()
Method to return true if the user have admin privs

Returns:
true if user has admin privs

isVFT

public boolean isVFT()
Method to return true if this user have vft admin. BTW, admin users get vft admin by default.

Returns:
true if user have vft admin priv

setVFT

public void setVFT(boolean vft)
Method to set the user vft flag.

Parameters:
vft - the user vft flag.

getFtCapListStr

public String getFtCapListStr()
Accessor to the file type capabilities list string.

Returns:
the file type capabilities string.

setFtCapListStr

public void setFtCapListStr(String ftCapListStr)
Method to set the file type capabilities string.

Parameters:
ftCapListStr - the file type capabilities string.

getVFTCapListStr

public String getVFTCapListStr()
Accessor method to the vft capabilities list string.

Returns:
the vft capabilities list string.

setVFTCapListStr

public void setVFTCapListStr(String vftCapListStr)
Method to set the vft capabilities list string.

Parameters:
vftCapListStr - the vft capabilities list string.