Revision c9af7679
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java | ||
---|---|---|
31 | 31 |
|
32 | 32 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
33 | 33 |
import eu.etaxonomy.cdm.model.name.RegistrationStatus; |
34 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
35 |
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD; |
|
34 | 36 |
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction.Action; |
35 | 37 |
import eu.etaxonomy.cdm.vaadin.event.ReferenceEditorAction; |
36 | 38 |
import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent; |
37 | 39 |
import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationWorkingSet; |
40 |
import eu.etaxonomy.cdm.vaadin.security.UserHelper; |
|
38 | 41 |
import eu.etaxonomy.cdm.vaadin.util.formatter.DateTimeFormat; |
39 | 42 |
import eu.etaxonomy.cdm.vaadin.util.formatter.TimePeriodFormatter; |
40 | 43 |
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO; |
... | ... | |
176 | 179 |
setComponentError(new UserError("Citation is missing")); |
177 | 180 |
} |
178 | 181 |
|
179 |
updateUI(regDto.getBibliographicCitationString(), regDto.getCreated(), regDto.getDatePublished(), |
|
180 |
regDto.getMessages().size(), |
|
182 |
updateUI(regDto.getBibliographicCitationString(), regDto.getCreated(), regDto.getDatePublished(), regDto.getMessages().size(), |
|
181 | 183 |
navigationEvent, null, regDto, regDto.getSubmitterUserName()); |
182 | 184 |
} |
183 | 185 |
|
184 | 186 |
public void setWorkingSet(RegistrationWorkingSet workingSet, AbstractView<?> parentView){ |
185 | 187 |
this.parentView = parentView; |
186 | 188 |
|
187 |
ReferenceEditorAction referenceEditorAction; |
|
189 |
ReferenceEditorAction referenceEditorAction = null;
|
|
188 | 190 |
if(workingSet.getCitationId() != null){ |
189 |
referenceEditorAction = new ReferenceEditorAction(Action.EDIT, workingSet.getCitationId()); |
|
191 |
if(UserHelper.fromSession().userHasPermission(Reference.class, workingSet.getCitationId(), CRUD.UPDATE)){ |
|
192 |
referenceEditorAction = new ReferenceEditorAction(Action.EDIT, workingSet.getCitationId()); |
|
193 |
} |
|
190 | 194 |
} else { |
191 |
referenceEditorAction = new ReferenceEditorAction(Action.ADD); |
|
195 |
if(UserHelper.fromSession().userHasPermission(Reference.class, CRUD.CREATE)){ |
|
196 |
referenceEditorAction = new ReferenceEditorAction(Action.ADD); |
|
197 |
} |
|
192 | 198 |
} |
193 | 199 |
TimePeriod datePublished = null; |
194 | 200 |
String submitterName = null; |
Also available in: Unified diff
ref #6999 protecting reference edit buttons