Revision 67bf2db8
Added by Andreas Kohlbecker over 5 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO; |
38 | 38 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet; |
39 |
import eu.etaxonomy.cdm.model.ICdmCacher; |
|
40 |
import eu.etaxonomy.cdm.model.ICdmUuidCacher; |
|
39 | 41 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
40 | 42 |
import eu.etaxonomy.cdm.model.name.RegistrationStatus; |
41 | 43 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
100 | 102 |
|
101 | 103 |
private Panel blockingRelationsPanel; |
102 | 104 |
|
105 |
private ICdmUuidCacher cache; |
|
106 |
|
|
103 | 107 |
/** |
104 | 108 |
* |
105 | 109 |
*/ |
106 |
public RegistrationItem(RegistrationDTO item, AbstractView<?> parentView) { |
|
110 |
public RegistrationItem(RegistrationDTO item, AbstractView<?> parentView, ICdmUuidCacher cache) {
|
|
107 | 111 |
super(GRID_COLS, GRID_ROWS); |
112 |
this.cache = cache; |
|
108 | 113 |
init(); |
109 | 114 |
setItem(item, parentView); |
110 | 115 |
} |
... | ... | |
112 | 117 |
/** |
113 | 118 |
* |
114 | 119 |
*/ |
115 |
public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView<?> parentView) { |
|
120 |
public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView<?> parentView, ICdmUuidCacher cache) {
|
|
116 | 121 |
super(GRID_COLS, GRID_ROWS); |
122 |
this.cache = cache; |
|
117 | 123 |
init(); |
118 | 124 |
blockedByButton.setVisible(false); |
119 | 125 |
setWorkingSet(workingSet, parentView); |
... | ... | |
207 | 213 |
|
208 | 214 |
ReferenceEditorAction referenceEditorAction = null; |
209 | 215 |
if(workingSet.getCitationUuid() != null){ |
210 |
if(UserHelperAccess.userHelper().userHasPermission(Reference.class, workingSet.getCitationUuid(), CRUD.UPDATE)){ |
|
216 |
if(UserHelperAccess.userHelper().withCache(cache).userHasPermission(Reference.class, workingSet.getCitationUuid(), CRUD.UPDATE)){
|
|
211 | 217 |
referenceEditorAction = new ReferenceEditorAction(EditorActionType.EDIT, workingSet.getCitationUuid(), null, null, parentView); |
212 | 218 |
} |
213 | 219 |
PermissionDebugUtils.addGainPerEntityPermissionButton(this, Reference.class, workingSet.getCitationUuid(), EnumSet.of(CRUD.UPDATE, CRUD.DELETE), null); |
... | ... | |
345 | 351 |
throw new RuntimeException("No point showing blocking registrations for an unblocked registration"); |
346 | 352 |
} |
347 | 353 |
|
348 |
blockingRelationsPanel = new RegistrationItemsPanel(parentView, "blocked by", blockingRegDTOs); |
|
354 |
blockingRelationsPanel = new RegistrationItemsPanel(parentView, "blocked by", blockingRegDTOs, cache);
|
|
349 | 355 |
addComponent(blockingRelationsPanel, 0, 4, GRID_COLS - 1, 4); |
350 | 356 |
} |
351 | 357 |
|
Also available in: Unified diff
ref #7785 preliminary commit