/** * Does the current user have permission to access this screen. * @return NORMAL_RETURN if access is allowed, ACCESS_DENIED or LOGIN_REQUIRED otherwise. */ public int checkSecurity() { int iErrorCode = super.checkSecurity(); if (iErrorCode == DBConstants.NORMAL_RETURN) { // 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 strContactID = this.getScreenRecord().getField(LookupScreenRecord.VENDOR_ID).toString(); if (Vendor.VENDOR_FILE.equalsIgnoreCase(strUserContactType)) { if ((strContactID == null) || (strContactID.length() == 0)) if ((strUserContactID != null) && (strUserContactID.length() > 0)) this.getScreenRecord().getField(LookupScreenRecord.VENDOR_ID).setString(strContactID = strUserContactID); iErrorCode = this.checkContactSecurity(Vendor.VENDOR_FILE, strContactID); } } return iErrorCode; } /**
/** * Does the current user have permission to access this screen. * @return NORMAL_RETURN if access is allowed, ACCESS_DENIED or LOGIN_REQUIRED otherwise. */ public int checkSecurity() { int iErrorCode = super.checkSecurity(); if (iErrorCode == DBConstants.NORMAL_RETURN) { // 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 strContactID = this.getScreenRecord().getField(LookupScreenRecord.VENDOR_ID).toString(); if (Vendor.VENDOR_FILE.equalsIgnoreCase(strUserContactType)) { if ((strContactID == null) || (strContactID.length() == 0)) if ((strUserContactID != null) && (strUserContactID.length() > 0)) this.getScreenRecord().getField(LookupScreenRecord.VENDOR_ID).setString(strContactID = strUserContactID); iErrorCode = this.checkContactSecurity(Vendor.VENDOR_FILE, strContactID); } } return iErrorCode; } /**
/** * Open the files and setup the screen. * @param record The main record for this screen. * @param itsLocation The location of this component within the parent. * @param parentScreen The parent screen. * @param fieldConverter The field this screen field is linked to. * @param iDisplayFieldDesc Do I display the field desc? */ public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String, Object> properties) { m_iNavCount = 0; // Nav buttons super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); int iErrorCode = this.checkSecurity(); if ((iErrorCode != DBConstants.NORMAL_RETURN) && (iErrorCode != Constants.READ_ACCESS)) return; if (iErrorCode == Constants.READ_ACCESS) this.setAppending(false); // Add in the columns m_iNavCount = this.getSFieldCount(); this.addNavButtons(); m_iNavCount = this.getSFieldCount() - m_iNavCount; // Nav buttons this.getScreenFieldView().setupTableFromModel(); this.resizeToContent(this.getTitle()); } /**
/** * Open the files and setup the screen. * @param record The main record for this screen. * @param itsLocation The location of this component within the parent. * @param parentScreen The parent screen. * @param fieldConverter The field this screen field is linked to. * @param iDisplayFieldDesc Do I display the field desc? */ public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String, Object> properties) { m_iNavCount = 0; // Nav buttons super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); int iErrorCode = this.checkSecurity(); if ((iErrorCode != DBConstants.NORMAL_RETURN) && (iErrorCode != Constants.READ_ACCESS)) return; if (iErrorCode == Constants.READ_ACCESS) this.setAppending(false); // Add in the columns m_iNavCount = this.getSFieldCount(); this.addNavButtons(); m_iNavCount = this.getSFieldCount() - m_iNavCount; // Nav buttons this.getScreenFieldView().setupTableFromModel(); this.resizeToContent(this.getTitle()); } /**