code: public int checkSecurity()
      {
          int iErrorCode = super.checkSecurity();
          if ((iErrorCode == DBConstants.NORMAL_RETURN) || (iErrorCode == Constants.READ_ACCESS))
          {   // Okay, their group can access this screen, but can this user access this data?
              String strUserContactType = this.getProperty(DBParams.CONTACT_TYPE);
              String strUserContactID = this.getProperty(DBParams.CONTACT_ID);
          
              String strContactTypeID = this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_TYPE_ID).toString();
              if ((strContactTypeID == null) || (strContactTypeID.length() == 0))
                  if ((strUserContactType != null) && (strUserContactType.length() > 0))
              {
                  if (!Utility.isNumeric(strUserContactType))
                  {
                      ContactType recContactType = (ContactType)((ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_TYPE_ID)).getReferenceRecord(this);
                      strUserContactType = Integer.toString(recContactType.getIDFromCode(strUserContactType));
                  }
                  this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_TYPE_ID).setString(strContactTypeID = strUserContactType);
              }
              String strContactID = this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_ID).toString();
              if ((strContactID == null) || (strContactID.length() == 0))
                  if ((strUserContactID != null) && (strUserContactID.length() > 0))
                      this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_ID).setString(strContactID = strUserContactID);
              iErrorCode = this.checkContactSecurity(strContactTypeID, strContactID);
          }
          return iErrorCode;
      }
docs: Does the current user have permission to access this screen.
  @return NORMAL_RETURN if access is allowed, ACCESS_DENIED or LOGIN_REQUIRED otherwise.