use of org.kuali.kfs.kns.inquiry.InquiryRestrictions in project cu-kfs by CU-CommunityApps.
the class CuBusinessObjectAuthorizationServiceImpl method getInquiryRestrictions.
@Override
public InquiryRestrictions getInquiryRestrictions(BusinessObject businessObject, Person user) {
InquiryRestrictions inquiryRestrictions = super.getInquiryRestrictions(businessObject, user);
if (inquiredObjectIsVendorDetail(businessObject) && shouldHideAttachmentLinkOnVendorInquiry(user)) {
VendorDetail vendorDetail = (VendorDetail) businessObject;
List<Note> boNotes = vendorDetail.getBoNotes();
for (int i = 0; i < boNotes.size(); i++) {
String attachmentLinkPropertyPath = MessageFormat.format(COLLECTION_ITEM_PROPERTY_PATH_FORMAT, CUKRADPropertyConstants.BO_NOTES, i, CUKRADPropertyConstants.ATTACHMENT_LINK);
inquiryRestrictions.addHiddenField(attachmentLinkPropertyPath);
}
}
return inquiryRestrictions;
}
use of org.kuali.kfs.kns.inquiry.InquiryRestrictions in project cu-kfs by CU-CommunityApps.
the class PersonInquirableImpl method getSections.
/**
* Add Role Qualifier Attributes to Roles section of Person Inquiry.
*/
@Override
public List<Section> getSections(BusinessObject businessObject) {
List<Section> sections = new ArrayList<>();
if (getBusinessObjectClass() == null) {
LOG.error("Business object class not set in inquirable.");
throw new RuntimeException("Business object class not set in inquirable.");
}
InquiryRestrictions inquiryRestrictions = KNSServiceLocator.getBusinessObjectAuthorizationService().getInquiryRestrictions(businessObject, GlobalVariables.getUserSession().getPerson());
Collection<InquirySectionDefinition> inquirySections = getBusinessObjectDictionaryService().getInquirySections(getBusinessObjectClass());
for (InquirySectionDefinition inquirySection : inquirySections) {
String sectionId = inquirySection.getId();
if (!inquiryRestrictions.isHiddenSectionId(sectionId)) {
Section section = SectionBridge.toSection(this, inquirySection, businessObject, inquiryRestrictions);
if (StringUtils.equals(sectionId, "rolesSection") || StringUtils.equals(sectionId, "delegationsSection")) {
int memberIndex = 0;
for (Row containerRow : section.getRows()) {
List<Row> containerRows = containerRow.getFields().get(0).getContainerRows();
Row lastRow = containerRows.get(containerRows.size() - 1);
// we want the new fields added before any sub-sections (i.e. container fields)
if (Field.CONTAINER.equals(lastRow.getField(0).getFieldType())) {
containerRows.addAll(containerRows.size() - 1, buildRowsWithQualifierFields(sectionId, (PersonImpl) businessObject, memberIndex));
} else {
containerRows.addAll(buildRowsWithQualifierFields(sectionId, (PersonImpl) businessObject, memberIndex));
}
memberIndex++;
}
}
sections.add(section);
}
}
return sections;
}
Aggregations