Revision 3b278eb0
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 |
import eu.etaxonomy.cdm.api.utility.UserHelper;
|
|
40 |
import eu.etaxonomy.cdm.model.ICdmEntityUuidCacher;
|
|
41 | 41 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
42 | 42 |
import eu.etaxonomy.cdm.model.name.RegistrationStatus; |
43 | 43 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
102 | 102 |
|
103 | 103 |
private Panel blockingRelationsPanel; |
104 | 104 |
|
105 |
private ICdmUuidCacher cache; |
|
105 |
private ICdmEntityUuidCacher cache;
|
|
106 | 106 |
|
107 | 107 |
/** |
108 | 108 |
* |
109 | 109 |
*/ |
110 |
public RegistrationItem(RegistrationDTO item, AbstractView<?> parentView, ICdmUuidCacher cache) { |
|
110 |
public RegistrationItem(RegistrationDTO item, AbstractView<?> parentView, ICdmEntityUuidCacher cache) {
|
|
111 | 111 |
super(GRID_COLS, GRID_ROWS); |
112 | 112 |
this.cache = cache; |
113 | 113 |
init(); |
... | ... | |
117 | 117 |
/** |
118 | 118 |
* |
119 | 119 |
*/ |
120 |
public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView<?> parentView, ICdmUuidCacher cache) { |
|
120 |
public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView<?> parentView, ICdmEntityUuidCacher cache) {
|
|
121 | 121 |
super(GRID_COLS, GRID_ROWS); |
122 | 122 |
this.cache = cache; |
123 | 123 |
init(); |
... | ... | |
213 | 213 |
|
214 | 214 |
ReferenceEditorAction referenceEditorAction = null; |
215 | 215 |
if(workingSet.getCitationUuid() != null){ |
216 |
if(UserHelperAccess.userHelper().withCache(cache).userHasPermission(Reference.class, workingSet.getCitationUuid(), CRUD.UPDATE)){
|
|
216 |
if(cdmUserHelper().userHasPermission(Reference.class, workingSet.getCitationUuid(), CRUD.UPDATE)){
|
|
217 | 217 |
referenceEditorAction = new ReferenceEditorAction(EditorActionType.EDIT, workingSet.getCitationUuid(), null, null, parentView); |
218 | 218 |
} |
219 | 219 |
PermissionDebugUtils.addGainPerEntityPermissionButton(this, Reference.class, workingSet.getCitationUuid(), EnumSet.of(CRUD.UPDATE, CRUD.DELETE), null); |
... | ... | |
232 | 232 |
referenceEditorAction, FontAwesome.EDIT, null, submitterName); |
233 | 233 |
} |
234 | 234 |
|
235 |
/** |
|
236 |
* @return |
|
237 |
*/ |
|
238 |
private UserHelper cdmUserHelper() { |
|
239 |
if(cache != null){ |
|
240 |
return UserHelperAccess.userHelper().withCache(cache); |
|
241 |
} else { |
|
242 |
return UserHelperAccess.userHelper(); |
|
243 |
} |
|
244 |
} |
|
245 |
|
|
235 | 246 |
|
236 | 247 |
/** |
237 | 248 |
* @param submitterUserName TODO |
Also available in: Unified diff
ref #7785 using CdmTransientEntityAndUuidCacher to promote using the CachingCdmUserHelper