edu.jhu.tmaj.beans.manytomany
Class UsersSpecimens

java.lang.Object
  extended by edu.jhu.tmaj.beans.manytomany.UsersSpecimens

public final class UsersSpecimens
extends java.lang.Object

Represents the table UsersSpecimens, where users are assigned to specimens. The UsersSpecimens table is used to determine what users can see what specimens. However, just because the record is not there does not mean the user does not have access. The user could have all access for the SpecimensAppPermission,which would mean they would have access to every specimen regardless of what is in the UsersSpecimens table. Since Specimens are linked to Blocks and blocks to TissueDiagnosis, the UsersSpecimens table controls user access to not only specimens, but blocks and TissueDiagnosis as well.


Constructor Summary
UsersSpecimens()
           
 
Method Summary
static void ensureUserWillSeeSpecimenInSpecimensApp(UserBean userBean, int specimenID, boolean isSpecimenNew)
          Guarantee that the given user will be able to access to given specimen.
static void insertUsersSpecimens(int userID, int specimenID)
          Inserts a record into the UsersSpecimens Table.
static boolean isRecordInUsersSpecimensTable(int userID, int specimenID)
          Returns true if the UserID/SpecimenID pair is in the UsersSpecimens table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsersSpecimens

public UsersSpecimens()
Method Detail

ensureUserWillSeeSpecimenInSpecimensApp

public static void ensureUserWillSeeSpecimenInSpecimensApp(UserBean userBean,
                                                           int specimenID,
                                                           boolean isSpecimenNew)
                                                    throws java.sql.SQLException
Guarantee that the given user will be able to access to given specimen.

Throws:
java.sql.SQLException

isRecordInUsersSpecimensTable

public static boolean isRecordInUsersSpecimensTable(int userID,
                                                    int specimenID)
                                             throws java.sql.SQLException
Returns true if the UserID/SpecimenID pair is in the UsersSpecimens table. This would indicate the userID has access to the specimen.

Throws:
java.sql.SQLException

insertUsersSpecimens

public static void insertUsersSpecimens(int userID,
                                        int specimenID)
                                 throws java.sql.SQLException
Inserts a record into the UsersSpecimens Table.

Throws:
java.sql.SQLException